# Heartbeat Indices not getting cleaned up

**URL:** <https://discuss.elastic.co/t/heartbeat-indices-not-getting-cleaned-up/170527>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [March 1, 2019, 3:46pm UTC](https://discuss.elastic.co/t/heartbeat-indices-not-getting-cleaned-up/170527 "2019-03-01T15:46:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cawoodm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cawoodm/32/14083_2.png) [@cawoodm](https://discuss.elastic.co/u/cawoodm)\
**Post date:** [March 1, 2019, 3:46pm UTC](https://discuss.elastic.co/t/heartbeat-indices-not-getting-cleaned-up/170527/1 "2019-03-01T15:46:32Z")

</div>

Heartbeat seems to be creating endless `heartbeat-6.5.4-yyyy.MM.dd` indices and not cleaning them up.

1. How can we define when such indices can be deleted? Metricbeat, APM and other modules seem to do this
2. How exactly can we define less granular (e.g. monthly) index templates? I've never mastered the idea of `setup.template.name` and `setup.template.pattern` in ES...

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)\
**Post date:** [March 1, 2019, 5:19pm UTC](https://discuss.elastic.co/t/heartbeat-indices-not-getting-cleaned-up/170527/2 "2019-03-01T17:19:36Z")

</div>

@cawoodm APM and metricbeat do not do any automatic cleanup. Are you perhaps perhaps using curator or something similar to do that?

If you want indexes organized by something other than the default pattern it's not the template pattern you need to change (necessarily), but rather the `output.elasticsearch.index` setting. That's documented on [this page](https://www.elastic.co/guide/en/beats/heartbeat/current/heartbeat-template.html#heartbeat-template).

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)\
**Post date:** [March 1, 2019, 5:20pm UTC](https://discuss.elastic.co/t/heartbeat-indices-not-getting-cleaned-up/170527/3 "2019-03-01T17:20:12Z")

</div>

We have, BTW, documented curator here: [https://www.elastic.co/guide/en/apm/server/current/reduce-storage.html#delete-data-periodically](https://www.elastic.co/guide/en/apm/server/current/reduce-storage.html#delete-data-periodically)

In 7.x we'll support index lifecycle management which may obviate the need for curator in your case.

---

<div class="post-metadata">

**Author:** ![cawoodm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cawoodm/32/14083_2.png) [@cawoodm](https://discuss.elastic.co/u/cawoodm)\
**Post date:** [March 5, 2019, 9:07am UTC](https://discuss.elastic.co/t/heartbeat-indices-not-getting-cleaned-up/170527/4 "2019-03-05T09:07:43Z")

</div>

OK, that's a bummer. We don't have curator and I like to keep my indices in check.  
Looks like v7 will help our case.  
Thanks!

---

<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:** [April 2, 2019, 9:07am UTC](https://discuss.elastic.co/t/heartbeat-indices-not-getting-cleaned-up/170527/5 "2019-04-02T09:07:55Z")

</div>

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