How to write query for a variable for an elasticsearch source?

In the dashboard settings, I want to create a variable so that I can have the option to see the metrics panel for that particular host. I cannot seem to figure out the correct query syntax for the fields that contains the host IP to be used as a variable. Can someone help on this?

You need to use Lucene syntax.

Okay, but the query field requires a json. I have a field named “tags.aws_private_ip” that holds the IP address. Putting the query in the json format gives me unexpected token error. Could you give me an example of what exactly should go into the query ?

http://docs.grafana.org/features/datasources/elasticsearch/#query-variable

1 Like

Thanks. This helped alot!

Will it be possible to query values like count or distinct count in the variables using ES?