# How to clean the .watcher-history index?

**URL:** <https://discuss.elastic.co/t/how-to-clean-the-watcher-history-index/104362>\
**Category:** Elasticsearch\
**Created:** [October 18, 2017, 9:50am UTC](https://discuss.elastic.co/t/how-to-clean-the-watcher-history-index/104362 "2017-10-18T09:50:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Becker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martin_becker/32/22885_2.png) [@Martin\_Becker](https://discuss.elastic.co/u/Martin_Becker)\
**Post date:** [October 18, 2017, 9:50am UTC](https://discuss.elastic.co/t/how-to-clean-the-watcher-history-index/104362/1 "2017-10-18T09:50:26Z")

</div>

I use some watches to monitor incoming data on a production system. Therefore I created a dashboard (found it on [github](https://github.com/elastic/examples/tree/master/Alerting/watcher_dashboard)). Before installing the correct watches I tried some stupid stuff which now appears in the .watcher-history-\* index. Can I remove data from this index? How would I do remove all data for a watch named "some-watch"?

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:** [October 18, 2017, 10:18am UTC](https://discuss.elastic.co/t/how-to-clean-the-watcher-history-index/104362/2 "2017-10-18T10:18:38Z")

</div>

Hey,

the watch history basically contains information about each watch execution. Allows for good debugging, in case you are wondering why a watch action triggered or an email did not get send but you expected it to be (maybe the condition did not match, or sending of the email timed out).

if you dont need the data at all, you could delete the whole index, but that eliminates the possibility to check out this for any watch. Alternatively you can run a [delete by query](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-delete-by-query.html) and only delete watches for a certain `watch_id` by specifying the correct query.

Hope this helps!

--Alex

---

<div class="post-metadata">

**Author:** ![Martin\_Becker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martin_becker/32/22885_2.png) [@Martin\_Becker](https://discuss.elastic.co/u/Martin_Becker)\
**Post date:** [October 18, 2017, 10:30am UTC](https://discuss.elastic.co/t/how-to-clean-the-watcher-history-index/104362/3 "2017-10-18T10:30:17Z")

</div>

\_delete\_by\_query works for this case.

---

<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:** [November 15, 2017, 10:30am UTC](https://discuss.elastic.co/t/how-to-clean-the-watcher-history-index/104362/4 "2017-11-15T10:30:18Z")

</div>

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