# Get some information in Message Watcher

**URL:** https://discuss.elastic.co/t/get-some-information-in-message-watcher/225370
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [March 27, 2020, 9:18am UTC](https://discuss.elastic.co/t/get-some-information-in-message-watcher/225370 "2020-03-27T09:18:12Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Downer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/downer/32/65179_2.png) [@Downer](https://discuss.elastic.co/u/Downer)
#### Post date: [March 27, 2020, 9:18am UTC](https://discuss.elastic.co/t/get-some-information-in-message-watcher/225370/1 "2020-03-27T09:18:12Z")

</div>

Hello !

I'm new in the world of elastic. I would like to know if it is possible with watcher to get some variables and use it in "Message" (example: slack). I would like to create a watcher that send me a message on slack when I get HTTP server down. I'm ok with that but I don't know how to get url.full and http.response.status\_code from my hearbeat-\* indice. So if someone can give me documentation or little explanation to guide my search.

Downer

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [March 30, 2020, 2:50pm UTC](https://discuss.elastic.co/t/get-some-information-in-message-watcher/225370/2 "2020-03-30T14:50:43Z")

</div>

Hey,

yes, this is possible, as you can use mustache in those fields. The first snippet in the [slack action](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/actions-slack.html) documentation makes use of that directly.

Hope that helps as a start!

--Alex

---

<div class="post-metadata">

### Author: ![Downer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/downer/32/65179_2.png) [@Downer](https://discuss.elastic.co/u/Downer)
#### Post date: [March 31, 2020, 7:01am UTC](https://discuss.elastic.co/t/get-some-information-in-message-watcher/225370/3 "2020-03-31T07:01:38Z")

</div>

Hello,

Thank you for your answer.  
I have seen that but how to fill the "ctx" or other variable to get them in message field. I need to learn elasticsearch to create my own input. I think variable in message field depend of `input`  
That's right ?

Downer

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [March 31, 2020, 11:17am UTC](https://discuss.elastic.co/t/get-some-information-in-message-watcher/225370/4 "2020-03-31T11:17:00Z")

</div>

The `ctx.payload` variable includes **all** of your data of the input. So if you execute a search, the whole response is available there. Can you explain why that is not sufficient?

---

<div class="post-metadata">

### Author: ![Downer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/downer/32/65179_2.png) [@Downer](https://discuss.elastic.co/u/Downer)
#### Post date: [March 31, 2020, 11:57am UTC](https://discuss.elastic.co/t/get-some-information-in-message-watcher/225370/5 "2020-03-31T11:57:53Z")

</div>

Ok ok it's sufficient. I just need to learn how to make an advanced watcher with a good input. Thanks for all.

---

<div class="post-metadata">

### Author: ![kd0807](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kd0807/32/65371_2.png) [@kd0807](https://discuss.elastic.co/u/kd0807)
#### Post date: [March 31, 2020, 9:56pm UTC](https://discuss.elastic.co/t/get-some-information-in-message-watcher/225370/6 "2020-03-31T21:56:49Z")

</div>

How can i get the list of all the available input whose value can be shown used in the action. For example i want to include filebeat index having field user.name . How can i include it in email action with user.name value?  
Where can i run these to get all supported values?

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [April 3, 2020, 1:29pm UTC](https://discuss.elastic.co/t/get-some-information-in-message-watcher/225370/7 "2020-04-03T13:29:25Z")

</div>

Please open a new thread for a new question the next time. If you need some more examples to get more familiar with the watcher templating syntax and how to parse search results, take a look at the [examples repo](https://github.com/elastic/examples/tree/master/Alerting/).

---

<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: [May 1, 2020, 1:42pm UTC](https://discuss.elastic.co/t/get-some-information-in-message-watcher/225370/8 "2020-05-01T13:42:05Z")

</div>

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