Exclude item from variable query

I have created a template which enables me to select a particular device to populate the chart, which works fine except the dropdown includes an item that I don’t want to show.
The tag “diverter” is on a different measurement, and it’s data is not compatible with the chart.


The variable for “Type” is shown below, and I have tried excluding “device” by using Regex, but that doesn’t seem to work.

Can the Query be modified to only include the measurement “sensors”, and exclude “iot”?


You can use FROM <measurement>

That’s what I tried first, but grafana will not accept FROM in that query.

If I add FROM "sensors" to the existing query, it just errors.

You have incorrect syntax. Correct one:

SHOW TAG VALUES FROM "<measurement>" WITH KEY = "<key>"

1 Like

Yes, that works OK, Jan
Thank you, I appreciate your help.