What Grafana version and what operating system are you using?
Grafana 11.1.4
What are you trying to achieve?
Use custom variable in regex of transformation ‘Filter data by values’ to filter single values and also show all values.
What did you expect to happen?
Return data based on regex
The variable $MyColors has custom values like this:
.*
red
green
blue
I entered the value .* in ‘Custom all value’. This is to show records with any color as ‘All’ option.
But for some reason I always get ‘No data’ no matter which color I select.
If I enter .* manually inside the transformations value field, the data is there as expected.
It works also if I enter one of the colors inside the transformations value field.
It seems that the custom variable is not considered or evaluated by the regex?
What I am missing please?
Please note:
I know that I can use custom variables in the database query, but I want to achive a client side filtering to avoid multiple queries against the database if user changes the color value.
transformationsVariableSupport is already enabled (by Grafana default)
I know that I can use variables in query. But this is what I wanted to avoid as I posted in my 1st message under the ‘Please note’ section.
I don’t want to run another query against the database server. I want to get client side filtering to speed up and reduce load on database server.