How to remove duplicates of variable preview in Dashboard settings?

  • What Grafana version and what operating system are you using?
    Grafana v7.5.17 (84411794f3)
    Windows 11

  • What are you trying to achieve?
    When creating a variable within Dashboard, the preview value should be no duplicate.

  • How are you trying to achieve it?
    NA

  • What happened?


    In the “Preview of values”, there are many duplicates. Here we use color to represent different values. There are 2 black colors, 2 red colors, 2 green colors, and 3 yellow colors.

  • What did you expect to happen?
    Each value of preview should be unique

  • Can you copy/paste the configuration(s) that you are having problems with?
    Please see above screenshot.

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

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

In Grafana v7.5.17 on Windows 11, encountering duplicate values in variable previews can be resolved by reviewing your data source and query.

First, verify that your data source doesn’t contain duplicates. Check the variable query to ensure it doesn’t inadvertently generate duplicate results. You may need to adjust the query or use variables for filtering.

Data preprocessing outside Grafana might be necessary to remove duplicates if your data source lacks this capability. Additionally, consider upgrading Grafana for potential bug fixes.

Seeking assistance from Grafana’s community forums or support can provide tailored solutions for your specific data source and use case.

1 Like

What do you get when you run the same lucene query in kibana for example?