Tracking containment alerts: document fields in notification mail body

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

{
  "_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:

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

and

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.

are you using watcher or alerting?

Kibana Alerting

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