# How to auto delete the old data

**URL:** <https://discuss.elastic.co/t/how-to-auto-delete-the-old-data/1053>\
**Category:** Elasticsearch\
**Created:** [May 21, 2015, 1:47am UTC](https://discuss.elastic.co/t/how-to-auto-delete-the-old-data/1053 "2015-05-21T01:47:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JulianZhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julianzhang/32/44854_2.png) [@JulianZhang](https://discuss.elastic.co/u/JulianZhang)\
**Post date:** [May 21, 2015, 1:47am UTC](https://discuss.elastic.co/t/how-to-auto-delete-the-old-data/1053/1 "2015-05-21T01:47:04Z")

</div>

We want use LEK for the application log search.

But there are two question I don't find answer in the docs.

1, We just need search the log which generate in 30 days, How can I setting in the config file?  
2, How to config the ES to store data in compress model?

thanks

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [May 21, 2015, 2:02am UTC](https://discuss.elastic.co/t/how-to-auto-delete-the-old-data/1053/2 "2015-05-21T02:02:06Z")

</div>

All data in Elasticsearch is compressed by default.

Try Elasticsearch Curator for index retention.

[https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html)

---

<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:** [July 6, 2017, 12:12am UTC](https://discuss.elastic.co/t/how-to-auto-delete-the-old-data/1053/3 "2017-07-06T00:12:47Z")

</div>


