# How not to overwrite duplicates? save old documents

**URL:** <https://discuss.elastic.co/t/how-not-to-overwrite-duplicates-save-old-documents/238656>\
**Category:** Logstash\
**Created:** [June 25, 2020, 11:44am UTC](https://discuss.elastic.co/t/how-not-to-overwrite-duplicates-save-old-documents/238656 "2020-06-25T11:44:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lyubava](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@lyubava](https://discuss.elastic.co/u/lyubava)\
**Post date:** [June 25, 2020, 11:44am UTC](https://discuss.elastic.co/t/how-not-to-overwrite-duplicates-save-old-documents/238656/1 "2020-06-25T11:44:15Z")

</div>

Hi all!

I use this filter to prevent duplicates:

```auto
fingerprint {
    source => "name"
    target => "[@metadata][fingerprint]"
    method => "MURMUR3"
}

```

And it works. I don't see documents with the same 'name' field in Kibana.

But if a document already exists with the same fingerprint, Elasticsearch will replace the existing contents with the one me just provided - the last indexed document wins.

How can I configure Logstash not to overwrite an existing document, but simply not add a new one if there is already a similar 'name' field?

Please tell me what to do. I'm desperate.

---

<div class="post-metadata">

**Author:** ![Jenni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jenni/32/29684_2.png) [@Jenni](https://discuss.elastic.co/u/Jenni)\
**Post date:** [June 25, 2020, 12:33pm UTC](https://discuss.elastic.co/t/how-not-to-overwrite-duplicates-save-old-documents/238656/2 "2020-06-25T12:33:44Z")

</div>

If you use the action "create", the document won't be updated:  
[https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-action](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-action)

---

<div class="post-metadata">

**Author:** ![lyubava](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@lyubava](https://discuss.elastic.co/u/lyubava)\
**Post date:** [June 25, 2020, 1:36pm UTC](https://discuss.elastic.co/t/how-not-to-overwrite-duplicates-save-old-documents/238656/3 "2020-06-25T13:36:20Z")

</div>

Thanks you! You saved me. This is what I need 👍

---

<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 23, 2020, 1:36pm UTC](https://discuss.elastic.co/t/how-not-to-overwrite-duplicates-save-old-documents/238656/4 "2020-07-23T13:36:24Z")

</div>

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