# Loop through watcher results to create multiple actions

**URL:** <https://discuss.elastic.co/t/loop-through-watcher-results-to-create-multiple-actions/96827>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [August 11, 2017, 11:39pm UTC](https://discuss.elastic.co/t/loop-through-watcher-results-to-create-multiple-actions/96827 "2017-08-11T23:39:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![devans](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/devans/32/21073_2.png) [@devans](https://discuss.elastic.co/u/devans)\
**Post date:** [August 11, 2017, 11:39pm UTC](https://discuss.elastic.co/t/loop-through-watcher-results-to-create-multiple-actions/96827/1 "2017-08-11T23:39:59Z")

</div>

I'm looking to create a filesystem monitor based off of metricbeat and [this](https://github.com/elastic/examples/tree/master/Alerting/Sample%20Watches/filesystem_usage) sample watch.

I want to perform a webhook action to create tickets in our ticketing system. However, if multiple servers/filesystems return over the threshold, I want to create separate tickets for each. So essentially loop through an action for each returned document. Is there a way to accomplish this, or a good strategy to perform this task?

Thanks,  
Dave

---

<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:** [August 14, 2017, 7:14am UTC](https://discuss.elastic.co/t/loop-through-watcher-results-to-create-multiple-actions/96827/2 "2017-08-14T07:14:52Z")

</div>

Hey Dave,

watcher itself cannot do this currently. I think the easiest way is to send the data over to logstash using the `http` input of logstash and the `webhook` action from watcher and then do this on the logstash side, which is more flexible.

--Alex

---

<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:** [September 11, 2017, 7:14am UTC](https://discuss.elastic.co/t/loop-through-watcher-results-to-create-multiple-actions/96827/3 "2017-09-11T07:14:58Z")

</div>

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