Tags Query : Grafana / influxdb formatting

I have in my database a list of hosts
I set a variable $NodeId that allows me to select one or more hosts
A priori, it is possible to group multiple hosts with a tag
But I can not find the syntax for multiple tags
With the function : variable/tags query

Site1: equip101, equip102, equip103
Site 2: equip201, equip202, equip203

I want 2 tags : Site1 et Site 2
For example,
When I click on Site1 the hosts equip101 and equip102 are selected
When I click on Site2 the hosts equip201 and equip202 are selected

thanks in advance

What you need to do is tag it that way coming into InfluxDB.

You should include the tag site = 1, equipment = equip101 or something like that. That will allow scaling. I don’t know if you can do good searching by a tag key. Settings it to a value will allow you to do easy filtering

@Esity is right that the only real way to make this work nicely (/in a scalable way) is to apply the site as a separate tag.

If you really need to do filtering on your existing data in Grafana, the way you describe, you can create a template variable ($filterVar) with a dropdown with some hardcoded values like (equip101|equip102|equip103) or equip10.*, equip20.*, etc, and use that variable in a query filter on your existing tag, e.g WHERE NodeID =~ /^[[filterVar]]$/. But that’s obviously pretty ugly.

1 Like