How to filter panels in dashboard using variables

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

  • What are you trying to achieve?
    I have multiple panels, want to filter it out based on the value chosen from the variable.

  • How are you trying to achieve it?
    I created a variable and populated pre-defined values to it. marked this variable to chose one value at a time.

  • What happened?
    I am able to apply this filter in the query of each panel, however panels are appearing blank and they are still displayed in the dashboard.

What did you expect to happen?
My expectation is to hide those panels that doesn’t match to the criteria. that means, to display panels that match to the value selected from the variable.

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

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    I didn’t receive any error.

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

Hi @vjsre

I think you should examine this example dashboard on our public sandbox:

the number of panels changes based on the number of servers that you choose from the variable dropdown. I would inspect how this dashboard uses template variables and try to replicate the pattern

1 Like

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