What Grafana version and what operating system are you using?
10.4.3
What are you trying to achieve?
I try to replace variable query from influxdb with regex with specific value
For exemple i use some query whitch give me result :
ILO2_test or ILO4_test or ILO25_test
i want toget back a variable list with 2 for ILO2_test , 4 for ILO4_test and 0025 for ILO25_test
How are you trying to achieve it?
with regex but nor found good one if exist
What happened?
nothing
What did you expect to happen?
Can you copy/paste the configuration(s) that you are having problems with?
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
No error
Not sure if I understand your question correctly… Do you want to initialize several dashboard variables from your single query?
Or do you just want to perform some regex-based postprocessing on values returned by your query?
If this is the case, flux’s regexp package could help:
|> map(fn: (r) => {
tmp_ = regexp.replaceAllString(r: /^ILO/, t: "", v: r["txt"])
num = regexp.replaceAllString(r: /_test$/, t: "", v: tmp_)
return { r with num: num }
})