Search code examples
grafanainfluxdbfluxgrafana-variable

How to select multiple variables on variables filter of Grafana?


I've configured a variable called "product" which contains the following values:

prod1,prod2,prod3,prod4

I've already selected the multi-value option as the image below:

Multi-value select variable

The measurement in influxdb is something like that:

col1    col2    col3
A       prod1   10
B       prod2   20
C       prod3   30
D       prod1   40
E       prod4   50

So I don't have a row with the col2 set as prod1+prod2. When I try selecting prod1 and prod2 on my dashboard variable, I get No Data

Is there a different way to configure the variables for my dashboard so I can select multi-values correctly? Or do I have to create the rows prod1+prod2, prod2+prod3 on my Influxdb measurement?


Solution

  • I think you have to use Advanced variable format options, the "Regex" option should resolve your problem.

    See more info about formatting multi-value variables here too.