Power BI
let
makeFilter = (filter as record) as text =>
let
val = Text.FromBinary(Json.FromValue(filter))
in
val,
FetchData = (options as record, optional records as nullable list) as list =>
let
CurrentSource = Json.Document(Web.Contents(#"cloud", options)),
records = if records <> null then records & CurrentSource[records] else CurrentSource[records],
ScrollId = try CurrentSource[scroll_id] otherwise null,
Check = if ScrollId <> null
then @FetchData([
RelativePath = "/api/v1/tables/" & #"workgroupId" & "/" & #"table" & "/search/scroll",
Query = [ scroll_id = ScrollId ],
Headers=[Authorization="Bearer "&#"API token"]
], records)
else records
in
Check
in
FetchData([
// do not cache
IsRetry = true,
RelativePath = "/api/v1/tables/" & #"workgroupId" & "/" & #"table" & "/search",
Query = [
rows = "10000",
sort = "-event_time",
timeframe = "6 hours ago",
filters = {
makeFilter([ field = "cpu_usage", operator = ">", value = "10" ])
}
],
Headers=[Authorization="Bearer "&#"API token"]
])Parameter
Description
Suggested Values
Modifying the query
TL;DR
Other suggestions
Last updated
Was this helpful?