# Delete data older than 30 days

**URL:** <https://discuss.elastic.co/t/delete-data-older-than-30-days/362564>\
**Category:** Elasticsearch\
**Created:** [July 4, 2024, 2:22pm UTC](https://discuss.elastic.co/t/delete-data-older-than-30-days/362564 "2024-07-04T14:22:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lshmikanth](https://avatars.discourse-cdn.com/v4/letter/l/e47774/32.png) [@lshmikanth](https://discuss.elastic.co/u/lshmikanth)\
**Post date:** [July 4, 2024, 2:22pm UTC](https://discuss.elastic.co/t/delete-data-older-than-30-days/362564/1 "2024-07-04T14:22:25Z")

</div>

I have an index in Elasticsearch which stores huge data. Till two weeks I was able to delete the data older than 30 days by DELETE BY QUERY with some time. At that time it's storage is 40% used. Now it has reached 77% and I am unable to delete the data more than 1000 records or 1 batch by DELETE BY QUERY. With scroll size maximum it is taking is 10000 records. I want to clear the data to avoid 100% storage usage. Please help in providing ideas to clear 30 days older data and save the rest of data. Thanks in advance

---

<div class="post-metadata">

**Author:** ![Alex\_Salgado-Elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_salgado-elastic/32/103081_2.png) [@Alex\_Salgado-Elastic](https://discuss.elastic.co/u/Alex_Salgado-Elastic)\
**Post date:** [July 4, 2024, 2:38pm UTC](https://discuss.elastic.co/t/delete-data-older-than-30-days/362564/2 "2024-07-04T14:38:28Z")

</div>

> [@lshmikanth](#):
>
> I have an index in Elasticsearch which stores huge data. Till two weeks I was able to delete the data older than 30 days by DELETE BY QUERY with some time. At that time it's storage is 40% used. Now it has reached 77% and I am unable to delete the data more than 1000 records or 1 batch by DELETE BY QUERY. With scroll size maximum it is taking is 10000 records. I want to clear the data to avoid 100% storage usage. Please help in providing ideas to clear 30 days older data and save the rest of data. Thanks in advance

Hi @lshmikanth,

Have you considered using other methods such as:

- **Index Lifecycle Management (ILM)**: This can be found [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-lifecycle-management.html).
- **Delete by Query with Slices** : Detailed documentation is available [here](https://www.elastic.co/guide/en/elasticsearch/reference/8.14/docs-delete-by-query.html).

Regarding the delete by query, these articles might help you:

- [Elasticsearch Delete Index Performance](https://discuss.elastic.co/t/elasticsearch-delete-index-performance/243301)
- [How to Delete an Index in Elasticsearch](https://opster.com/guides/elasticsearch/how-tos/elasticsearch-delete-index/)
- [Elasticsearch Delete Document](https://opster.com/guides/elasticsearch/glossary/elasticsearch-delete-document/)
