# Tracking containment alerts: document fields in notification mail body

**URL:** https://discuss.elastic.co/t/tracking-containment-alerts-document-fields-in-notification-mail-body/310022
**Category:** Kibana
**Tags:** elastic-stack-alerting
**Created:** [July 19, 2022, 12:49pm UTC](https://discuss.elastic.co/t/tracking-containment-alerts-document-fields-in-notification-mail-body/310022 "2022-07-19T12:49:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![stefanoste.ml](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefanoste.ml/32/79630_2.png) [@stefanoste.ml](https://discuss.elastic.co/u/stefanoste.ml)
#### Post date: [July 19, 2022, 12:49pm UTC](https://discuss.elastic.co/t/tracking-containment-alerts-document-fields-in-notification-mail-body/310022/1 "2022-07-19T12:49:45Z")

</div>

Hello,  
I set up a rule to send an email when a document contains a location (Point) that is contained in a specific area.  
The rules triggers correctly the alert, but I haven't been able to add to the mail body field from the document.  
The document is a json of this kind

```auto
{
  "_index": "index-2022.07.19",
  "_id": "2W1OFoIBvTe4_JXgv2Mc",
  "_version": 1,
  "_score": null,
  "fields": {
    "location": [
      {
        "coordinates": [
          17.4318,
          40.5679
        ],
        "type": "Point"
      }
    ],
    "myLocation": [
      "[A1234]"
    ]
  ]
}

```

I've tried the following notations:

```auto
{{#context.hits}}
item with id {{_source.myIDField}} entered the area at {{_source.myLocation}} 
{{/context.hits}}

```

and

```auto
item with id {{context.hits.0.myIDField}} entered the area at {{context.hits.0.myLocation}}

```

Any suggestion on how to read those field?

Thanks for any help you could provide,  
S.

---

<div class="post-metadata">

### Author: ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)
#### Post date: [July 23, 2022, 5:44pm UTC](https://discuss.elastic.co/t/tracking-containment-alerts-document-fields-in-notification-mail-body/310022/2 "2022-07-23T17:44:10Z")

</div>

are you using watcher or alerting?

---

<div class="post-metadata">

### Author: ![stefanoste.ml](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefanoste.ml/32/79630_2.png) [@stefanoste.ml](https://discuss.elastic.co/u/stefanoste.ml)
#### Post date: [July 25, 2022, 9:58am UTC](https://discuss.elastic.co/t/tracking-containment-alerts-document-fields-in-notification-mail-body/310022/3 "2022-07-25T09:58:14Z")

</div>

Kibana Alerting

---

<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: [August 22, 2022, 9:58am UTC](https://discuss.elastic.co/t/tracking-containment-alerts-document-fields-in-notification-mail-body/310022/4 "2022-08-22T09:58:17Z")

</div>

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