# How long does it take for elastic to clean watcher-history indices after enabling \`xpack.watcher.history.cleaner\_service.enabled\`?

**URL:** <https://discuss.elastic.co/t/how-long-does-it-take-for-elastic-to-clean-watcher-history-indices-after-enabling-xpack-watcher-history-cleaner-service-enabled/189814>\
**Category:** Elasticsearch\
**Created:** [July 10, 2019, 3:30pm UTC](https://discuss.elastic.co/t/how-long-does-it-take-for-elastic-to-clean-watcher-history-indices-after-enabling-xpack-watcher-history-cleaner-service-enabled/189814 "2019-07-10T15:30:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmartori](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jmartori/32/36981_2.png) [@jmartori](https://discuss.elastic.co/u/jmartori)\
**Post date:** [July 10, 2019, 3:30pm UTC](https://discuss.elastic.co/t/how-long-does-it-take-for-elastic-to-clean-watcher-history-indices-after-enabling-xpack-watcher-history-cleaner-service-enabled/189814/1 "2019-07-10T15:30:55Z")

</div>

Hi everyone,  
We noticed that we had over 490 indices from watcher-history, that we probably should have deleted a while ago.  
I enabled `xpack.watcher.history.cleaner_service.enabled` and with the current configuration in should only keep the last 7 days.  
When does elastic decide that it should delete those indices? At the end/beginning of the day with the creation of the new index? Is there are way to nudge elastic into doing it sooner?

I couldn't find it in the watcher documentation page.  
[https://www.elastic.co/guide/en/elasticsearch/reference/5.6/notification-settings.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/notification-settings.html)

Thanks for your help

---

<div class="post-metadata">

**Author:** ![jmartori](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jmartori/32/36981_2.png) [@jmartori](https://discuss.elastic.co/u/jmartori)\
**Post date:** [July 11, 2019, 11:47am UTC](https://discuss.elastic.co/t/how-long-does-it-take-for-elastic-to-clean-watcher-history-indices-after-enabling-xpack-watcher-history-cleaner-service-enabled/189814/2 "2019-07-11T11:47:31Z")

</div>

So apparently it was the second case, and elastic cleaned the older indices on its own.  
It would still be nice to be able to force elastic into cleaning the old indices at any given time and not waiting for it to do it at midnight.

Thanks for the help and have a nice day!

---

<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:** [August 8, 2019, 11:47am UTC](https://discuss.elastic.co/t/how-long-does-it-take-for-elastic-to-clean-watcher-history-indices-after-enabling-xpack-watcher-history-cleaner-service-enabled/189814/3 "2019-08-08T11:47:37Z")

</div>

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