@rickyarkan I’m not 100% if this would fit your use case, but we do the following:
Firstly, let’s say we have a set of Influx tags like the following:
- a
site
tag, with values like 1, 2, 3
- a
system
tag, with values like 1a, 1b, 1c, 2a, 2b, 2c, 3a, etc.
Basically, each site will have a number of systems that are at that site.
We then have two template variables:
-
$site_filter
, which is of type Query, with values from the following query:
SHOW TAG VALUES FROM "data" WITH KEY = "site"
Here data
is of course the measurement name; and
-
$system_filter
, which is again of type Query, based on the following:
SHOW TAG VALUES FROM "data" WITH KEY="system" WHERE "site" =~ /^$site_filter$/
Now, importantly (at least for this example), “Multi-value” and “Include All option” should be ticked, and the “Custom all value” should be left blank (auto). [This works well if the number of systems is reasonably modest. If it’s large (e.g. hundreds), then there’s another approach that works better.]
The result, in terms of UI for the template variables, is you’ll get a Site drop-down and a System drop-down. If you select a site in the site drop-down, you’ll get all the available systems for that site in the systems drop-down. You can select any or all of those systems (and if you desire you can select multiple sites also).
Finally, the queries for the actual charts will look like
SELECT * FROM "data" WHERE "system" =~ /^$system_filter$/
Since we did not define the “Custom all value”, the $system_filter
will expand to either (a) all the individually selected systems, or (b) all the systems for all selected sites. Which should generally get you the data corresponding to the drop-downs.
This should be reasonably straightforward from a UI perspective, without relying on the (experimental?) value groups/tags functionality.