Hello,
- Using InfluxDB 1.8
- Grafana 7.1.5
I am trying to use templating variables in my Flux query. So variable1 is set up as:
SHOW TAG VALUES WITH KEY = “myTag”
And then I enable the “Multi-value” and “Include All option” in the variable’s settings.
I get no data returned from the query, because selecting “All” passes in a list for {$variable1}.
Here is the filter part of the query:
|> filter(fn: (r) => r._measurement == "stuff" and r._field == "my_field" and r._value > 0 and r.myTag == "${variable1}"
When I inspect the query, I can see that it is generating this query:
|> filter(fn: (r) => r._measurement == "stuff" and r._field == "my_field" and r._value > 0 and r.myTag == "{someValue1,someValue2,someValue3,someValue4,someValue5}"
So this query is obviously not formatted correctly for InfluxDB which needs the values OR’d together or some type of regular expression.
Any ideas on how I can fix this query so that I can use templated variables with the “all” and multi value" options?
Thanks!