# Ctx" variables in Alerts

**URL:** <https://discuss.elastic.co/t/ctx-variables-in-alerts/276403>\
**Category:** Kibana\
**Tags:** elastic-stack-alerting\
**Created:** [June 18, 2021, 3:45pm UTC](https://discuss.elastic.co/t/ctx-variables-in-alerts/276403 "2021-06-18T15:45:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robin020](https://avatars.discourse-cdn.com/v4/letter/r/71c47a/32.png) [@Robin020](https://discuss.elastic.co/u/Robin020)\
**Post date:** [June 18, 2021, 3:45pm UTC](https://discuss.elastic.co/t/ctx-variables-in-alerts/276403/1 "2021-06-18T15:45:52Z")

</div>

Hello,

I am trying to create an generic alert. I would like to send a message to my telegram bot. Currently I have this script:

> { "text": " {{ctx.monitor.name}}:  
> Please investigate the issue.
> 
> - Severity: {{ctx.trigger.severity}}  
> "  
> }

In my index I have a field called "scanned\_host". I am trying to add this field in this script. Is this possible? If yes, how?

Regards,  
Robin

---

<div class="post-metadata">

**Author:** ![Patrick\_Mueller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_mueller/32/109425_2.png) [@Patrick\_Mueller](https://discuss.elastic.co/u/Patrick_Mueller)\
**Post date:** [June 29, 2021, 2:02pm UTC](https://discuss.elastic.co/t/ctx-variables-in-alerts/276403/2 "2021-06-29T14:02:48Z")

</div>

I'm guessing this question is related to Watcher, as opposed to Kibana Alerting. Watcher questions are probably best asked in the Elasticsearch area of this Discuss site.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 27, 2021, 2:03pm UTC](https://discuss.elastic.co/t/ctx-variables-in-alerts/276403/3 "2021-07-27T14:03:39Z")

</div>

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