Reputation: 1723
I have a grafana dashboard that I want to filter by 2 variables:
This is relatively easy - I filter via a regex based on ${namespace} and everything works:
The problem arises when I want to perform a string manipulation on the namespace variable before using it to filter out values, e.g. my namespace is called mvng-test-pipeline, but I only want to see queues whose names contain "test-pipeline" (disregard the "mvng-" prefix). I didn't find a way to do it via regex. I also tried to create an intermediate variable, but surprisingly, I couldn't find a way to manipulate the variables using even the simplest string manipulations such as replace() or substring().
Would appreciate any help, 10x
Upvotes: 1
Views: 4401
Reputation: 22321
When you get the "namespace" variable from Prometheus, remove the "mvng-" prefix with a Regex like the following:
/^mvng\-(.+)$/
Upvotes: 1