Reputation: 1
I am converting a dashboard for Linux system information that has many dropdown menus to filter the dashboard. Many of the items are from the schema influxdb and have converted them just fine but this one is a challenge since it's also filtering on the $server variable to extract the key values from the schema:
SHOW TAG VALUES FROM "disk" WITH KEY = "path" WHERE host =~ /$server/
I have looked at this page for the documentation for schema queries but nothing seems to match for using a WHERE clause:
https://docs.influxdata.com/influxdb/v2.2/query-data/flux/explore-schema/
Upvotes: 0
Views: 501
Reputation: 731
You need to use |> filter()
https://docs.influxdata.com/flux/v0.x/stdlib/universe/filter/
Like:
import "influxdata/influxdb/schema"
schema.measurementTagValues(
bucket: "example-bucket",
tag: "example-tag",
measurement: "example-measurement",
)
|> filter(fn: (r) => r._field = "foo" and
.....
)
Some more notes: you can have regex matching the same way you do in your query with =~
- https://docs.influxdata.com/flux/v0.x/spec/operators/
Upvotes: 0