Here are some useful queries for Grafana using Elasticsearch as data source.

For templating:

  • select all values of the column: {“find”: “terms”, “field”: “column_name”}
  • limit selected values with some query: {“find”: “terms”, “field”: “column_name”, “query”: “lucene:some_query”}
  • find all field names of type string in data (index name is part of data source definition): {“find”: “fields”, “type”: “string”}

For both templating and metrics:

  • select based on field with more possible values: column_name:(value1 OR value2 OR value3)