How to get the grafana alerting work with elasticsearch

I am trying to create an alert in grafana with Elasticsearch as a data source. The issue I am facing while setting up alert is I am not able to get the field value for hostname to popup under summary or description section. Does anyone have any idea on how to achieve it?

Below is the example of above requirement:

ORA:3114 alert happened on host=$host.hostname

Grafana version: v9.4.3
Elasticsearch version: 8.7.0

First of all, try use $labels instead of $host, and check if you used the group by function, that way, the hostname will be showing as a label.

Can you share a sample query for reference that will help a lot or screenshot will be fine

Please do note that if your label does not contain a dot (.) you don’t have to use the format as I did, just go with $labels.whatever

1 Like

Thank you!!! You are a life saver I wasted so much time on this now I can look forward.