# How to stop duplicate entries using elasticsearch plugin

**URL:** <https://discuss.elastic.co/t/how-to-stop-duplicate-entries-using-elasticsearch-plugin/87880>\
**Category:** Logstash\
**Created:** [June 1, 2017, 10:12am UTC](https://discuss.elastic.co/t/how-to-stop-duplicate-entries-using-elasticsearch-plugin/87880 "2017-06-01T10:12:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![paz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paz/32/28003_2.png) [@paz](https://discuss.elastic.co/u/paz)\
**Post date:** [June 1, 2017, 11:53am UTC](https://discuss.elastic.co/t/how-to-stop-duplicate-entries-using-elasticsearch-plugin/87880/2 "2017-06-01T11:53:04Z")

</div>

If id, type and destination index of the documents are the same, by default it should not create another instance of the same document, but rather just bump the version number of the already indexed document.

You can always try changing the default action of the output plugin to _create_ instead of the default _index_ (as per [https://www.elastic.co/guide/en/logstash/1.5/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-action](https://www.elastic.co/guide/en/logstash/1.5/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-action)), so the insert will fail for already existing documents.

Keep in mind though that you will potentially be flooded with 40x error responces from ES. Nothing to worry about since it's intended, but may take up space quickly depending on the amount of them.

---

_[View the full topic](https://discuss.elastic.co/t/how-to-stop-duplicate-entries-using-elasticsearch-plugin/87880)._
