Selecting multiple fields using variables, infuxDB

(I guess new users have to have simple problems. I had to remove all but two of the screenshots. Probably a futile effort without that, but I’ve already typed it all in so I’ll just remove the screenshots and you can use your imagination)

Just starting to use graphana with influxDB. Love it! But i’m having a lot of trouble using a variable to select fields to include in a graph.

I have an influxDB with a flat series of measurements containing multiple fields. I want to have a graph panel that can select multiple fields using a variable selector. I can build the variable from a simple query:
show field keys on iotawatt from home
and that works fine.

I have tried with “multi-value” on and off. Neither seems to work but different problems. First the simple case, with multi-value off. I specify the variable using the dropdown selector:
image
The query is:


which does not work. I really don’t understand why it’s using regexp anyway. If I overide by typing in:
DELETED
the query becomes:
DELETED
which works fine. So I guess the question in the case of the single value variable is how to eliminate the regexp, which seems ill formed anyway.

Now the real problem. I’d like to be able to select multiple fields in the same graph using the multi-value capability. So I turn on multi-value and specify two values:
DELETED
I choose the variable template in the dropdown list:
DELETED
Once again I get a regexp, and the query is:
DELETED
which doesn’t work.

Can someone point me in right direction to get these variables to work? The examples seem to deal with tags rather than fields, but I don’t see why it shouldn’t work with fields. I’ve thought about changing over to make all my fields tags, but that seems like an inefficient way to organize the data since all of the fields exist in each measurement.

@overeasy, if it makes you feel any better I’m in the same boat. Just ran into this tonight working with FreeNAS data (it exports in a graphite format that’s seemingly impossible to parse nicely to be able to use variables, and I have hundreds of disks that I simply can’t keep putting in manually in every single graph).

I am having the same problem…

for me, I also need to include the variable as part of the field name, e.g:

SELECT mean(“X_$myvariable_Speed”)

myvarible would have values like U1 and U2 and I want to create one graph for each, plotted together…

[UPDATE]
Solved it with the sintax: /^X_[[myvariable]]_Speed$/

1 Like

Have you solve your questions? I use grafana and influxdb recently and meet the same question as yours.

It might be long time ago, but I hope you can give me some suggestions :flushed: