# Elasticsearch documents getting updated with same document id

**URL:** <https://discuss.elastic.co/t/elasticsearch-documents-getting-updated-with-same-document-id/144920>\
**Category:** Logstash\
**Created:** [August 17, 2018, 2:37pm UTC](https://discuss.elastic.co/t/elasticsearch-documents-getting-updated-with-same-document-id/144920 "2018-08-17T14:37:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chandra0651](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chandra0651/32/30484_2.png) [@chandra0651](https://discuss.elastic.co/u/chandra0651)\
**Post date:** [August 17, 2018, 2:37pm UTC](https://discuss.elastic.co/t/elasticsearch-documents-getting-updated-with-same-document-id/144920/1 "2018-08-17T14:37:01Z")

</div>

Hello i am using one of the field to be made as document id when ingesting in ES and so that if any document comes with same document id, it shouldn't get ingested or updated. But i see the documents are getting updated.Below is my output config. I am using logstash-output-elasticsearch (9.0.2) version

```
output{
       elasticsearch {
           hosts => []
    index => "event-weight"
    doc_as_upsert => false
    document_id => "%{eventFingerprint}"
    cacert => ""
    user => elastic
    password => ""
    }
}
```

---

<div class="post-metadata">

**Author:** ![chandra0651](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chandra0651/32/30484_2.png) [@chandra0651](https://discuss.elastic.co/u/chandra0651)\
**Post date:** [August 20, 2018, 6:57pm UTC](https://discuss.elastic.co/t/elasticsearch-documents-getting-updated-with-same-document-id/144920/2 "2018-08-20T18:57:19Z")

</div>

Got this working by setting the "action" config to "create" in ES output

---

<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 17, 2018, 6:57pm UTC](https://discuss.elastic.co/t/elasticsearch-documents-getting-updated-with-same-document-id/144920/3 "2018-09-17T18:57:27Z")

</div>

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