# Elasticsearch Shard Retention

**URL:** <https://discuss.elastic.co/t/elasticsearch-shard-retention/80718>\
**Category:** Elasticsearch\
**Created:** [March 30, 2017, 4:19pm UTC](https://discuss.elastic.co/t/elasticsearch-shard-retention/80718 "2017-03-30T16:19:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bcable](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@bcable](https://discuss.elastic.co/u/bcable)\
**Post date:** [March 30, 2017, 4:19pm UTC](https://discuss.elastic.co/t/elasticsearch-shard-retention/80718/1 "2017-03-30T16:19:27Z")

</div>

Situation; I'm currently shipping windows logs to elasticsearch via winlogbeat and grabbing specific events from the past 3 months. All I really want is the last 3 months of logs and nothing else. Each day has its own index, with 5 shards per index and 450 shards for 90 days. So what is the best way in going about automated shard deletion?

Question;

1. Can I setup shards so they have 90 day TTL?
2. Shards have dates in their name, can I `if date < 90 days = delete` ?
3. Where do I set this up?

Any information provided will be much appreciated.

Thanks!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 30, 2017, 4:32pm UTC](https://discuss.elastic.co/t/elasticsearch-shard-retention/80718/2 "2017-03-30T16:32:43Z")

</div>

This is exactly what [Curator](https://www.elastic.co/guide/en/elasticsearch/client/curator/4.2/index.html) was designed to assist with.

---

<div class="post-metadata">

**Author:** ![bcable](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@bcable](https://discuss.elastic.co/u/bcable)\
**Post date:** [March 30, 2017, 5:18pm UTC](https://discuss.elastic.co/t/elasticsearch-shard-retention/80718/3 "2017-03-30T17:18:57Z")

</div>

Thanks man!

---

<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 27, 2017, 5:19pm UTC](https://discuss.elastic.co/t/elasticsearch-shard-retention/80718/4 "2017-04-27T17:19:14Z")

</div>

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