2

We want to have a single drop down for parameter X and we wish to deduce the other parameters say Y and Y from the selected X value.

Is it possible in Grafana?

Did not find much content around it

amankedia
  • 377
  • 2
  • 8
  • 23

1 Answers1

3

It is possible to use template variables within the query field of another template variable via $Variable_name, similarly to how you reference them in queries.

The exact format depends on the data-source but with influxDB it would look something like this.

  • First variable:

    • Name: Network
    • Query: SHOW TAG VALUES FROM readings WITH KEY = "network"
  • Second variable:

    • Name: Device
    • Query: SHOW TAG VALUES FROM readings WITH KEY = "device" where "network" = $Network

Basically, show a list of all networks in the first dropdown, and in the second dropdown only show devices that belong to the selected network. The second dropdown is updated dynamically.