InfluxDB - Repeating single query on multiple hosts via variable

Hi All,

My first post here, so apologies if this isn’t the right area!

I am setting up a Grafana dashboard for a lot of clusters, and i’m getting pretty bored of adding the same query 20 times for different host names! (I’m new to Grafana so now realise this is not the best way, especially for alerting on every query!!!)

I have set a custom multi-variable in the dashboard settings called $variablename for example, in which contains some server names, (servername01,servername02).

Im using the below query:

SELECT mean("Percent_Free_Space") FROM "win_disk" WHERE ("host" = '$variablename' AND "instance" = 'C:') AND $timeFilter GROUP BY time($__interval) fill(null)

I have selected all the servernames at the top of the dashboard, however its only outputting the one server (first one in the variable). I have also turned on panel repeating for the variable also.

I know its going to be something wrong with my query, and something silly! - Can anyone point me in the right direction with this one?

I’m new to Grafana so apologies if i’ve missed something very obvious!

Thanks in advance!

Are you doing it correctly. Just save dashboard (with variables) and refresh dashboard page in the browser. Then Grafana will loop through All variable values as you are expecting.


Thanks for that, just saved it, ensured i have all of the above set, and still nothing, only showing the one graph!

It’s reading the variable, as its displaying the first server fine, however not the rest!


Now you need to repeat panel for that variable.

Likewise how do I write a query (Grafana/InfluxDB) with select * from abc where cond1=~ /^var1/ and cond2=~ /^var2/ If var1 was All, second condition never gets picked.

Hey does anybody solved this. I am having the same issue, only the first value is show… not the rest