Template variable to display multiple series on graph

  • What Grafana version and what operating system are you using?
    8.0.2 on ubuntu-server
    Datasource is elasticsearch (filled by Graylog)

  • What are you trying to achieve?
    I try to use a template variable to display multiple series in a chart.
    The basic data structure is: Elasticsearch gets filled every 15 secons through graylog. In the message there are multiple fields regarding the state of the monitored Hyper- server. Included are also the cpu load (type:long) of every virtual machine running on the Hyper-V server. So each message looks like this:
    < elasticsearch entry>
    application_name: PS-PerfMon
    host: hyper-v-server
    CPU_Load_Guest_VMName1 Value: long
    CPU_Load_Guest_VMName2 Value: long

  • How are you trying to achieve it?
    I created a variable like seen in the picture:

And “tried” to create a graph - but I’m not exactly sure how to reference the variable right.
I basically want to avoid filling out everything by hand - if a VM gets deletet or added, I don’t want to change the graphs. This picture shows what I want to do (in the left one I reference every field by hand - and in the right one I want to use the variable but don’t know how):

1 Like

So I’ve tried with a variable that returns exactly one instance and used this variable in the graph for one series. That’s working fine … but how do I use a multi-variable and show a series for each field in the variable? Is this even possible?