# Kibana Alerts accessing fields

**URL:** <https://discuss.elastic.co/t/kibana-alerts-accessing-fields/280789>\
**Category:** Kibana\
**Tags:** elastic-stack-alerting\
**Created:** [August 9, 2021, 10:10am UTC](https://discuss.elastic.co/t/kibana-alerts-accessing-fields/280789 "2021-08-09T10:10:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bevano](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bevano](https://discuss.elastic.co/u/bevano)\
**Post date:** [August 9, 2021, 10:10am UTC](https://discuss.elastic.co/t/kibana-alerts-accessing-fields/280789/1 "2021-08-09T10:10:50Z")

</div>

Hi All,

Is it possible to access specific fields within Action boxes under Alerts in Kibana.

For example, I want to alert when the field "host.status" equals down. This is easy using the Elasticsearch Query. After this query matches, I need to send an email with the various info.

I have a field called "host.url" which contains the URL of the hosts. I am struggling on how I can access and bring this field into the message text box under action.

This was previously possible with watcher so I am thinking it should be possible here.  
I am running Elastic/Kibana 7.13.4, trying to migrate away from watcher.

Thanks

---

<div class="post-metadata">

**Author:** ![ying.mao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ying.mao/32/88151_2.png) [@ying.mao](https://discuss.elastic.co/u/ying.mao)\
**Post date:** [August 23, 2021, 12:39pm UTC](https://discuss.elastic.co/t/kibana-alerts-accessing-fields/280789/2 "2021-08-23T12:39:41Z")

</div>

Hi @bevano,

If you are using the Elasticsearch Query alert, you should be able to use mustache syntax to access document information inside your action. Documentation is available here: [Elasticsearch query | Kibana Guide [master] | Elastic](https://www.elastic.co/guide/en/kibana/master/rule-type-es-query.html#_add_action_variables_2)

The documents are available within the `context.hits` context variable, which is an array containing the matching documents. In order to access a field like `host.status`, try something like this:

```auto
{{#context.hits}}
Host URL {{_source.host.url}} matched!
{{/context.hits}}

```

Hope that helps!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 20, 2021, 12:40pm UTC](https://discuss.elastic.co/t/kibana-alerts-accessing-fields/280789/3 "2021-09-20T12:40:32Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
