# Index lifecycle management (cleanup) based on document fields

**URL:** <https://discuss.elastic.co/t/index-lifecycle-management-cleanup-based-on-document-fields/312465>\
**Category:** Elasticsearch\
**Created:** [August 19, 2022, 12:28pm UTC](https://discuss.elastic.co/t/index-lifecycle-management-cleanup-based-on-document-fields/312465 "2022-08-19T12:28:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joeripeeters](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@joeripeeters](https://discuss.elastic.co/u/joeripeeters)\
**Post date:** [August 19, 2022, 12:28pm UTC](https://discuss.elastic.co/t/index-lifecycle-management-cleanup-based-on-document-fields/312465/1 "2022-08-19T12:28:34Z")

</div>

Hi all,

I have an index with data that contains a start-date and end-date. Documents that have an end-date past today, are not valuable anymore. So ideally, I want them out of the index.

Is there a way to have index lifecycle management based on actual data?

Thanks in advance!

Cheers  
J

---

<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:** [August 19, 2022, 12:38pm UTC](https://discuss.elastic.co/t/index-lifecycle-management-cleanup-based-on-document-fields/312465/2 "2022-08-19T12:38:01Z")

</div>

No. ILM removes data by deleting complete indices, not specific documents within indices. You will need to use delete by query to achieve what you describe, which is something you will need to trigger yourself.

---

<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:** [September 16, 2022, 12:38pm UTC](https://discuss.elastic.co/t/index-lifecycle-management-cleanup-based-on-document-fields/312465/3 "2022-09-16T12:38:25Z")

</div>

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