# Include document fields in the message

**URL:** <https://forum.opensearch.org/t/include-document-fields-in-the-message/4122>\
**Category:** Open Source Elasticsearch and Kibana\
**Created:** [November 5, 2020, 9:23am UTC](https://forum.opensearch.org/t/include-document-fields-in-the-message/4122 "2020-11-05T09:23:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![agenobarb](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@agenobarb](https://forum.opensearch.org/u/agenobarb)\
**Post date:** [November 5, 2020, 9:23am UTC](https://forum.opensearch.org/t/include-document-fields-in-the-message/4122/1 "2020-11-05T09:23:53Z")

</div>

My condition in the Alerting is ‘when avg(field) over all documents for last 5 minutes’. My action is to send email.  
Can I include a few specific fields from these documents for which the condition is met - in the action message?  
I know I have access to ctx variables but not sure how to use it for my purpose?

---

<div class="post-metadata">

**Author:** ![stmx38](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/stmx38/32/4354_2.png) [@stmx38](https://forum.opensearch.org/u/stmx38)\
**Post date:** [November 6, 2020, 10:22am UTC](https://forum.opensearch.org/t/include-document-fields-in-the-message/4122/2 "2020-11-06T10:22:36Z")

</div>

Hello @agenobarb, can you please try to follow [example from this post](https://forum.opensearch.org/t/kibana-email-alert-extracting-field-results/3606/18)
