Templating, query type variable, top 10 terms


I want to use query type variable for choosing SystemCode, which can have one of over 200k values.
Limit of values is 500 in Grafana. Is it possible to create query which returns top 10 SystemCodes ?
Top 10 - i mean count of documents.
My current query:
{“find”: “terms”, “field”: “SystemCode.keyword”,“size”:10}

Thanks in advance !

Hi ^^
Can you tell me type of datasource you choose?
But I think you can select top 10 with any type datasource.

You can follow:
Add Select => Selectors => Top => Top(10).


Hi :slight_smile:
I forgot: it’s Elasticsearch 5.x
Please remember that i mean not metric query but query in Templating/Variable (query type variable)

Thanks !

There’s an open feature request with a submitted pull request that haven’t been merged yet that you can try out.


Good to know.
Thanks Marcus !