# Opensearch alerting -text message in action

**URL:** <https://forum.opensearch.org/t/opensearch-alerting-text-message-in-action/16377>\
**Category:** OpenSearch\
**Tags:** alerting\
**Created:** [October 22, 2023, 7:16am UTC](https://forum.opensearch.org/t/opensearch-alerting-text-message-in-action/16377 "2023-10-22T07:16:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![susta123](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@susta123](https://forum.opensearch.org/u/susta123)\
**Post date:** [October 22, 2023, 7:16am UTC](https://forum.opensearch.org/t/opensearch-alerting-text-message-in-action/16377/1 "2023-10-22T07:16:01Z")

</div>

Hi, I using opensearch 2.8.0. I need config alerting and sending alerts over smtp. So alerting is functional and sends emails. But I need modify text message in mail. Can opensearch sending in messages text content from index? I using opensearch for logging event from applications. And I need send log from application in mail body.  
how can I configure it?

Thank you for your answers

---

<div class="post-metadata">

**Author:** ![apaws06](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@apaws06](https://forum.opensearch.org/u/apaws06)\
**Post date:** [October 23, 2023, 4:22pm UTC](https://forum.opensearch.org/t/opensearch-alerting-text-message-in-action/16377/2 "2023-10-23T16:22:11Z")

</div>

Yes, try something like this:  
In Extraction Query:  
{  
“size”: 1,  
…  
}  
In Action Message:  
Monitor {{ctx.monitor.name}} just entered alert status. Please investigate the issue.

- Trigger: {{ctx.trigger.name}}
- Severity: {{ctx.trigger.severity}}
- Period start: {{ctx.periodStart}}
- Period end: {{ctx.periodEnd}}
- Message: {{ctx.results.0.hits.hits.0.\_source.@message}}
- Alerts: {{ctx.results}}

---

<div class="post-metadata">

**Author:** ![susta123](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@susta123](https://forum.opensearch.org/u/susta123)\
**Post date:** [October 26, 2023, 2:29pm UTC](https://forum.opensearch.org/t/opensearch-alerting-text-message-in-action/16377/3 "2023-10-26T14:29:21Z")

</div>

Thank you very much. It s working
