# Keep the "last" dump only in an elasticsearch index

**URL:** <https://discuss.elastic.co/t/keep-the-last-dump-only-in-an-elasticsearch-index/112318>\
**Category:** Logstash\
**Created:** [December 18, 2017, 10:06pm UTC](https://discuss.elastic.co/t/keep-the-last-dump-only-in-an-elasticsearch-index/112318 "2017-12-18T22:06:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr\_chang7](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@mr\_chang7](https://discuss.elastic.co/u/mr_chang7)\
**Post date:** [December 18, 2017, 10:06pm UTC](https://discuss.elastic.co/t/keep-the-last-dump-only-in-an-elasticsearch-index/112318/1 "2017-12-18T22:06:59Z")

</div>

Hi guys,

Let's say I have an index "A" that needs to keep the last dump of data. Data come in dumps with a few days of interval (irregular). The events of entities have entity ID's and I put each event by its ID (as document\_id) in the index A, Over the days there are existing entities and new entities coming in the dumps.

Whatever the case, I'd like to keep the index containing only the last dump of entities. But problem kicks in if some entities got deleted over the dumps since the index will still keep all the deleted ones.

I know it's not easy to remove the "deleted" entities from the index. How could you guys do in such situation?

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:** [January 15, 2018, 10:07pm UTC](https://discuss.elastic.co/t/keep-the-last-dump-only-in-an-elasticsearch-index/112318/2 "2018-01-15T22:07:10Z")

</div>

Closed on January 15, 2018, 10:07pm UTC

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