# Remove duplicates based on the timestamp and another field

**URL:** <https://discuss.elastic.co/t/remove-duplicates-based-on-the-timestamp-and-another-field/269519>\
**Category:** Logstash\
**Created:** [April 7, 2021, 7:45pm UTC](https://discuss.elastic.co/t/remove-duplicates-based-on-the-timestamp-and-another-field/269519 "2021-04-07T19:45:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)\
**Post date:** [April 7, 2021, 7:45pm UTC](https://discuss.elastic.co/t/remove-duplicates-based-on-the-timestamp-and-another-field/269519/1 "2021-04-07T19:45:42Z")

</div>

What method do you recommend to remove duplicates in an index, based on @timestamp and a field? somthing like this:

if @timestamp and interface\_name are equal, delete one of the document

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 7, 2021, 8:05pm UTC](https://discuss.elastic.co/t/remove-duplicates-based-on-the-timestamp-and-another-field/269519/2 "2021-04-07T20:05:22Z")

</div>

Use a fingerprint filter to hash those two together and set the document\_id on the elasticsearch output. A document that has the same hash will overwrite an existing document with that id.

---

<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:** [May 5, 2021, 8:05pm UTC](https://discuss.elastic.co/t/remove-duplicates-based-on-the-timestamp-and-another-field/269519/3 "2021-05-05T20:05:54Z")

</div>

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