# How to config watcher to output event to index?

**URL:** <https://discuss.elastic.co/t/how-to-config-watcher-to-output-event-to-index/217552>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [February 3, 2020, 1:39am UTC](https://discuss.elastic.co/t/how-to-config-watcher-to-output-event-to-index/217552 "2020-02-03T01:39:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lusynda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lusynda/32/53557_2.png) [@lusynda](https://discuss.elastic.co/u/lusynda)\
**Post date:** [February 3, 2020, 1:39am UTC](https://discuss.elastic.co/t/how-to-config-watcher-to-output-event-to-index/217552/1 "2020-02-03T01:39:58Z")

</div>

Hi all,  
I currently use elastic to store log file.  
Can some one tell me how to write the watcher to have the output to an index,  
I want whenever there is a something that matche my query then watcher will output the whole event(data) to an index

For example: if there is some user log in with error credentials then watcher will output the whole logfile to an index

Please help me

Thank you

---

<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:** [February 3, 2020, 3:19pm UTC](https://discuss.elastic.co/t/how-to-config-watcher-to-output-event-to-index/217552/2 "2020-02-03T15:19:46Z")

</div>

You can use the [index action](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/actions-index.html) for that.

---

<div class="post-metadata">

**Author:** ![lusynda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lusynda/32/53557_2.png) [@lusynda](https://discuss.elastic.co/u/lusynda)\
**Post date:** [February 4, 2020, 1:18am UTC](https://discuss.elastic.co/t/how-to-config-watcher-to-output-event-to-index/217552/3 "2020-02-04T01:18:01Z")

</div>

Yes thank you but can you tell me more, because i have tried to use the index action and it only index the number of result for me and the the actual data itself

---

<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:** [February 4, 2020, 8:55am UTC](https://discuss.elastic.co/t/how-to-config-watcher-to-output-event-to-index/217552/4 "2020-02-04T08:55:50Z")

</div>

sharing your watch would be a tremendous help, as then there is a base to discuss and change the action.

---

<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:** [March 3, 2020, 9:08am UTC](https://discuss.elastic.co/t/how-to-config-watcher-to-output-event-to-index/217552/5 "2020-03-03T09:08:12Z")

</div>

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