# Include link to search query in alert

**URL:** https://forum.opensearch.org/t/include-link-to-search-query-in-alert/2391
**Category:** Alerting
**Created:** [March 10, 2020, 7:15pm UTC](https://forum.opensearch.org/t/include-link-to-search-query-in-alert/2391 "2020-03-10T19:15:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jmetzmeier](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jmetzmeier](https://forum.opensearch.org/u/jmetzmeier)
#### Post date: [March 10, 2020, 7:15pm UTC](https://forum.opensearch.org/t/include-link-to-search-query-in-alert/2391/1 "2020-03-10T19:15:07Z")

</div>

I am attempting to configure an alert message on a trigger to contain a URL which will replicate the search query that produced the result. I believe information on the query itself exists in ctx.monitor.inputs. I am unable to locate any documentation on this object (outside of docs saying it exists). When trying to do a trial-and-error inspection of the object, I found that I can’t run any functions inside of the template engine.

How can inspect ctx objects for debugging purposes? Is there a way to run any custom functions inside of the alert message template? Are there any existing solutions for replicating the search query of the monitor?

---

<div class="post-metadata">

### Author: ![kris](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/kris/32/2208_2.png) [@kris](https://forum.opensearch.org/u/kris)
#### Post date: [February 7, 2023, 5:17pm UTC](https://forum.opensearch.org/t/include-link-to-search-query-in-alert/2391/2 "2023-02-07T17:17:55Z")

</div>


