Hello. I have a a variable in grafana with multiple values where these values are mapped to integers.
I can use multiple values in my flux expression with regex based filters with grafana expansion ${variable:pipe}
when field type data is “string”.
from(bucket: "oracle/autogen")
|> range(start: -2h)
|> filter(fn: (r) => r["_measurement"] == "tablespace" and r["environment"] =~ /^${environment:pipe}$/ and r["arq"] =~ /^${arq:pipe}$/ )
But I can not use it when field type is integer
from(bucket: "oracle/autogen")
|> range(start: -2h)
|> filter(fn: (r) => r["_measurement"] == "tablespace" and r["environment"] =~ /^${environment:pipe}$/ and r["arq"] =~ /^${arq:pipe}$/ )
|> filter(fn: (r) => r["db"] =~ /^${db:pipe}$/ )
|> v1.fieldsAsCols()
|> filter(fn: (r) => r["status"] =~ /${status:pipe}/ )
It shows this error.
Is there any way to build a filter like sql in clause in flux with integers ?
something like the following
|> filter(fn: (r) => r["status"] in (/${status:csv}/ )
how can I build this filter when I don’t know how much options user will choose ?