*Solved* Dashboard time range is not applied to variable query

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

  • What are you trying to achieve?

from: Elasticsearch query editor | Grafana documentation

{"find": "terms", "field": "hostname.keyword", "size": 1000}

Returns a list of values for a keyword using term aggregation. Query will use current dashboard time range as time range query.

However when I do my query:

{“find”:“terms”, “field”:“tag.my_variable.keyword”, “size”: 25}

I see the same set of alphabetized variables from any dashboard time ranges. The list of “my_variable” is changing constantly and at many points should be blank.

  • How are you trying to achieve it?

Messing with the variable query options. I cannot find any reliable documentation on the full list of query options I can do. All I can see are the few options on here: Elasticsearch query editor | Grafana documentation

from which there’s little to extrapolate on the various things I believe I can pass in to a grafana query.

  • What happened?

I see the same set of alphabetized variables from any dashboard time ranges. The list of “my_variable” is changing constantly and at many points should be blank.

  • What did you expect to happen?

The list of my_variable should change.

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

pasted above.

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

no errors.

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

url shared above.

My data was the issue here. This is working as expected.