Filtering with Flux in InfluxDB
InfluxDB
Flux
filtering
querying
How does filtering works with Flux in InfluxDB?
The filter() function behaves similarly to the WHERE command in SQL.
from(bucket: "trial_bucket")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "service_org_duration")
- The
fnparameter expects apredicate function, that is an anonymous function producing a boolean (true/false) output. The filtering will include rows for whichfnreturnstruebased on the expression. - The
rargument of thefnparameter stands for the rows.