2 dropdowns - one determines the values the other

How do I have a 2 dropdowns in grafana were dropdown1 determines the values that are present in dropdown2?

Below example

I want 2 dropdowns in grafana

dropdown1:
site1
site2
site3

dropdown2:
hosta
hostb
hostc
hostd
hoste
hostf
hostg
hosth
hosti

when site1 is selected in dropdown1
dropdown2 shows the following:
hosta
hostb
hostc

when site2 is selected in dropdown1
dropdown2 shows the following:
hostd
hoste
hostf

when site3 is selected in dropdown1
dropdown2 shows the following:
hostg
hosth
hosti

  • What Grafana version and what operating system are you using?
    7.5.7

  • What are you trying to achieve?
    as above

  • How are you trying to achieve it?
    as above

  • What happened?
    n/a

  • What did you expect to happen?
    n/a

  • Can you copy/paste the configuration(s) that you are having problems with?
    n/a

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    n/a

  • Did you follow any online instructions? If so, what is the URL?
    n/a

others related

put them into tables in db
and use nested/chain variable concept to handle the ‘one drop down determines the values of the other’

1 Like

for ref
here
here
here

here

this is what I want but this is for influxdb

1 Like

tks, but can I do it using static data? that is if the association(e.g. site1 = hosta, hostb and hostc…) is set up in the db yet? that is using a custom variable and not a query variable.

Set up your 1st drop-down variable (for my example the Name of the variable is “System”) :
select DISTINCT sys_name from STATIC_SYS_INFO

Then use the results of that to screen only what you want in the seconds variable:
select DISTINCT cpu_id from STATIC_SYS_INFO where sys_name="[[System]]"

tks but I think that is for influxDB? I am looking for doing it with a static list like in my example and also doing it with prometheus.

not sure how if you want it as a static data (not static table)
sorry

This topic was automatically closed after 365 days. New replies are no longer allowed.