# Can 	Watcher execute external script upon alert?

**URL:** https://discuss.elastic.co/t/can-watcher-execute-external-script-upon-alert/31663
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [October 5, 2015, 9:15pm UTC](https://discuss.elastic.co/t/can-watcher-execute-external-script-upon-alert/31663 "2015-10-05T21:15:11Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Tal\_Bar\_Or](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tal_bar_or/32/5127_2.png) [@Tal\_Bar\_Or](https://discuss.elastic.co/u/Tal_Bar_Or)
#### Post date: [October 5, 2015, 9:15pm UTC](https://discuss.elastic.co/t/can-watcher-execute-external-script-upon-alert/31663/1 "2015-10-05T21:15:11Z")

</div>

Hi All,  
I would like to use Watcher to execute external script on alert condition is it possible?  
If yes if can i get reference link to how to  
Please advice  
Thanks

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [October 5, 2015, 10:44pm UTC](https://discuss.elastic.co/t/can-watcher-execute-external-script-upon-alert/31663/2 "2015-10-05T22:44:10Z")

</div>

Not currently, no.

---

<div class="post-metadata">

### Author: ![elkuser](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elkuser/32/13483_2.png) [@elkuser](https://discuss.elastic.co/u/elkuser)
#### Post date: [October 3, 2016, 7:48pm UTC](https://discuss.elastic.co/t/can-watcher-execute-external-script-upon-alert/31663/3 "2016-10-03T19:48:58Z")

</div>

When will Watcher be able to execute external scripts upon alert? I have a similar requirement - and would like Watcher to execute a remote script when a certain alert condition occurs.

---

<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: [October 4, 2016, 11:49am UTC](https://discuss.elastic.co/t/can-watcher-execute-external-script-upon-alert/31663/4 "2016-10-04T11:49:54Z")

</div>

Watcher runs in the same sandbox as Elasticsearch does, with the java security manager enabled to prevent random reads/writes of files as well as executing any code (and many many more things to improve security). This is the reason, why you need another (hopefully more compartmentalized) component to execute scripts and use the webhook (or an index action) to trigger that.

--Alex

---

<div class="post-metadata">

### Author: ![elkuser](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elkuser/32/13483_2.png) [@elkuser](https://discuss.elastic.co/u/elkuser)
#### Post date: [October 5, 2016, 2:15am UTC](https://discuss.elastic.co/t/can-watcher-execute-external-script-upon-alert/31663/5 "2016-10-05T02:15:57Z")

</div>

Thank you, Alex - I will pursue the webhook route.

---

<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 6, 2017, 1:42pm UTC](https://discuss.elastic.co/t/can-watcher-execute-external-script-upon-alert/31663/6 "2017-07-06T13:42:41Z")

</div>


