# Opensearch alerting trigger custom message

**URL:** <https://forum.opensearch.org/t/opensearch-alerting-trigger-custom-message/27786>\
**Category:** OpenSearch\
**Tags:** alerting\
**Created:** [January 30, 2026, 5:23am UTC](https://forum.opensearch.org/t/opensearch-alerting-trigger-custom-message/27786 "2026-01-30T05:23:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeepm257](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@sandeepm257](https://forum.opensearch.org/u/sandeepm257)\
**Post date:** [January 30, 2026, 5:23am UTC](https://forum.opensearch.org/t/opensearch-alerting-trigger-custom-message/27786/1 "2026-01-30T05:23:29Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):3.0.0

**Describe the issue** :I need to set up an alert and trigger and trigger message should contain some custom fields in the messege

currently set up per query monitor with visual editor and in custom messege field in notification

Host: {{\_source.host}}  
Host IP: {{\_source.hostip}}

but the notification messege doesn’t contains any values, how can we fix it

**Configuration** :

**Relevant Logs or Screenshots** :

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [February 10, 2026, 11:49am UTC](https://forum.opensearch.org/t/opensearch-alerting-trigger-custom-message/27786/2 "2026-02-10T11:49:25Z")

</div>

> [@sandeepm257](#):
>
> Host: {{\_source.host}}  
> Host IP: {{\_source.hostip}}

@sandeepm257 Try the below instead

```auto
Host: {{ctx.results.0.hits.hits.0._source.host}}
Host IP: {{ctx.results.0.hits.hits.0._source.hostip}}

```

---

<div class="post-metadata">

**Author:** ![sandeepm257](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@sandeepm257](https://forum.opensearch.org/u/sandeepm257)\
**Post date:** [February 11, 2026, 6:46am UTC](https://forum.opensearch.org/t/opensearch-alerting-trigger-custom-message/27786/3 "2026-02-11T06:46:43Z")

</div>

![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/a/a7c566163ecd731f148a6d58884dfd294e31481c.png)

Hi Pablo

Thanks for reply, still we are getting some syntax error

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [February 11, 2026, 11:46am UTC](https://forum.opensearch.org/t/opensearch-alerting-trigger-custom-message/27786/4 "2026-02-11T11:46:02Z")

</div>

@sandeepm257 I’m getting the same error in 3.0.0. It looks like a bug when running a test message in OpenSearch Dashboards UI.  
When you enable the monitor, you’ll see messages with the valid values in your email notification.

I’ve tested against 3.4.0, and the test message has no errors with the same custom message.

---

<div class="post-metadata">

**Author:** ![sandeepm257](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@sandeepm257](https://forum.opensearch.org/u/sandeepm257)\
**Post date:** [February 11, 2026, 12:37pm UTC](https://forum.opensearch.org/t/opensearch-alerting-trigger-custom-message/27786/5 "2026-02-11T12:37:25Z")

</div>

Thanks pablo

The below messege is working fine in extraction query editor mode but not in visual editor

```auto
{{#ctx.results.0.hits.hits}}
  {{_source.host}}
  {{_source.hostip}}
{{/ctx.results.0.hits.hits}}

Thanks we can close this issue

```
