Reputation: 1499
I am using InfluxDB's Flux query language to filter by measurement names. I want to know if it is possible to query for a measurement that contains a substring? For example if I have the measurement name “foo_bar” can I use a filter to look for any measurement that has substring “bar”? I tried the below and it did not work. Alternatively I can use regex but want to know if this function should work?
|> filter(fn: (r) => strings.containsStr(v: r._measurement, substr: "bar")
Upvotes: 2
Views: 4167
Reputation: 138
Try
|> filter(fn: (r) => strings.containsStr(v: r._measurement, substr: "bar") == true)
Upvotes: 4