# Wrong document\_id when end with 0

**URL:** <https://discuss.elastic.co/t/wrong-document-id-when-end-with-0/229646>\
**Category:** Logstash\
**Created:** [April 24, 2020, 12:12pm UTC](https://discuss.elastic.co/t/wrong-document-id-when-end-with-0/229646 "2020-04-24T12:12:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgonzalezp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dgonzalezp/32/50804_2.png) [@dgonzalezp](https://discuss.elastic.co/u/dgonzalezp)\
**Post date:** [April 24, 2020, 12:12pm UTC](https://discuss.elastic.co/t/wrong-document-id-when-end-with-0/229646/1 "2020-04-24T12:12:42Z")

</div>

Hi everyone, I have the following ouput configuration file:

```
output {
    if "_jdbcstreamingdefaultsused" in [tags] {
            elasticsearch {
                            hosts => ["esdatahot01.siacloud.es:9200","esdatahot02.siacloud.es:9200"]
                            index => "unknown-%{customer}-safecert_certificados-bbdd"
                    }
    }
    if ([id_certificado]) {
            if "updated" in [tags] {
                    elasticsearch {
                            hosts => ["esdatahot01.siacloud.es:9200","esdatahot02.siacloud.es:9200"]
                            index => "log-%{customer}-safecert_certificados-bbdd"
                            action => "update"**
                            doc_as_upsert => "true"**
                            document_id => "%{id_copy}"**
                    }
            }
            else if "deleted" in [tags] {
                    elasticsearch {
                            hosts => ["esdatahot01.siacloud.es:9200","esdatahot02.siacloud.es:9200"]
                            index => "log-%{customer}-safecert_certificados-bbdd"
                            action => "delete"
                            document_id => "%{id_copy}"
                    }
            }
    }
}

```

As you can see Im using the field id\_copy as document\_id to update the current documents in ES index but when this id end with 0 ES delete it and add E+5  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/f/bf7fb0c06babd119bb0f94ec432ade465df08eed.png)

Im getting duplicates for this reason...

I have tried changing the type to string and integer but doesnt work... and as I said this only happend when end with a 0 all the others documents have been updated correctly

Any idea?

Thx

---

<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 22, 2020, 12:12pm UTC](https://discuss.elastic.co/t/wrong-document-id-when-end-with-0/229646/2 "2020-05-22T12:12:44Z")

</div>

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