# Custom functions in watcher

**URL:** <https://discuss.elastic.co/t/custom-functions-in-watcher/201189>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [September 26, 2019, 8:53am UTC](https://discuss.elastic.co/t/custom-functions-in-watcher/201189 "2019-09-26T08:53:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravitandur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravitandur/32/4568_2.png) [@ravitandur](https://discuss.elastic.co/u/ravitandur)\
**Post date:** [September 26, 2019, 8:53am UTC](https://discuss.elastic.co/t/custom-functions-in-watcher/201189/1 "2019-09-26T08:53:04Z")

</div>

Can we write some functions [in painless] and use them across multiple watchers?  
If possible, can u please share the details

---

<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:** [September 26, 2019, 2:19pm UTC](https://discuss.elastic.co/t/custom-functions-in-watcher/201189/2 "2019-09-26T14:19:48Z")

</div>

would stored scripts work for you or is intention to share more of your functions among different scripts?

---

<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:** [October 24, 2019, 2:19pm UTC](https://discuss.elastic.co/t/custom-functions-in-watcher/201189/3 "2019-10-24T14:19:51Z")

</div>

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