# How to include a field value in message body in Rules and Connectors?

**URL:** <https://discuss.elastic.co/t/how-to-include-a-field-value-in-message-body-in-rules-and-connectors/379126>\
**Category:** Kibana\
**Tags:** elastic-stack-monitoring, elastic-stack-alerting, detection-rules\
**Created:** [June 12, 2025, 8:42am UTC](https://discuss.elastic.co/t/how-to-include-a-field-value-in-message-body-in-rules-and-connectors/379126 "2025-06-12T08:42:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)\
**Post date:** [June 12, 2025, 10:59am UTC](https://discuss.elastic.co/t/how-to-include-a-field-value-in-message-body-in-rules-and-connectors/379126/2 "2025-06-12T10:59:39Z")

</div>

Hello @Dariia_Hrebenichenko

Please find the details in this blog :

> [@How to show fild's contain throught connector log](https://discuss.elastic.co/t/how-to-show-filds-contain-throught-connector-log/379125/2):
>
> Hello @Dariia_Hrebenichenko Welcome to the community. This will return all the values of filename as per the records which qualify your rule { "filename": "{{#context.hits}} {{\_source.filename}} {{/context.hits}}" } If you just want to display the first value : { "filename": "{{context.hits.0.\_source.filename}}" } Thanks!!

this seems to be duplicate.

Thanks!!

---

_[View the full topic](https://discuss.elastic.co/t/how-to-include-a-field-value-in-message-body-in-rules-and-connectors/379126)._
