-
What Grafana version and what operating system are you using?
Grafana v10.3.1 (00a22ff8b2) -
What are you trying to achieve?
By query, I’m trying to filter values from a variable based on a constant variable defined. -
How are you trying to achieve it?
SHOW TAG VALUES
FROM <measurement>
WITH KEY = "animal"
WHERE
(
("animal" =~ /"catXX.*/ AND /^$mamiffer$/ = "cat")
OR
("animal" =~ /"dogXX.*/ AND /^$mamiffer$/ = "dog")
)
-
What happened?
Empty output. -
What did you expect to happen?
I’m expecting that in the animal dropdown menu only certain animals are shown based on the value selected from the mamiffer dropdown menu (which is a custom variable with manually defined values), with a specific regex string.
The logic could be summarized as: select animal values from the database:
- if the “animal” starts with “dogXX” and the value of “mamiffer” is exactly “dog”.
- else if the “animal” starts with “catXX” and the value of “mamiffer” is exactly “cat”.
Thank you in advance for the help.