Reputation: 3367
I created a Grafana dashboard variable and tried to filter the values via the regex field. This works for static regex definition.
I would now like to use another variable inside the regex which provides the regex value.
So the regex field should look somehow like: /$theRealRegexVar/
I tried it with many different versions like /${theRealRegexVar}/
or /[[theRealRegexVar]]/
but it seems not to work.
Does it work somehow or is it simply impossible?
The datasource is prometheus.
The regex would be a regex ;-) (for example "^.*$" - however the user would provide it in the other variable)
Upvotes: 7
Views: 3067
Reputation: 171
Don't know, if an answer is still relevant. But there are two options:
$theRealRegexVar
directly in the query that delivers the values of your dashboard variable. For sure this only applies if your variable is a query.$theRealRegexVar
, see https://grafana.com/docs/grafana/latest/variables/advanced-variable-format-options/. A similar task worked for me with :raw
, so in your case put ${theRealRegexVar:raw}
into the regex field.Upvotes: 0