# Logstash upsert usage

**URL:** <https://discuss.elastic.co/t/logstash-upsert-usage/168244>\
**Category:** Logstash\
**Created:** [February 13, 2019, 2:49pm UTC](https://discuss.elastic.co/t/logstash-upsert-usage/168244 "2019-02-13T14:49:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![manikandanid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manikandanid/32/91013_2.png) [@manikandanid](https://discuss.elastic.co/u/manikandanid)\
**Post date:** [February 13, 2019, 2:49pm UTC](https://discuss.elastic.co/t/logstash-upsert-usage/168244/1 "2019-02-13T14:49:36Z")

</div>

I am merging two docs based on a ID which i frame it out from the document i receive. The two different doc which i want merge share the same ID and i merge it in logstash using upsert. The document are merging but at the same time error are found in logstash logs. One example is below

[2019-02-13T09:30:06,364][WARN][logstash.outputs.elasticsearch] Failed action. {:status=\>409, :action=\>["update", {:\_id=\>"beta-32104172.21.249.521.2.840.113837.73102298.1540581278.61.2.392.200036.9116.2.6.1.3268.2046999618.1540534879.921419iSyntaxInitImageTQ=0&sid=b4be6021-d8af-41c2-a114-a35a7ee7cb78", :\_index=\>"beta-2019-02", :\_type=\>"doc", :\_routing=\>nil, :\_retry\_on\_conflict=\>1}, #LogStash::Event:0x2634f921], :response=\>{"update"=\>{"\_index"=\>"beta-2019-02", "\_type"=\>"doc", "\_id"=\>"beta-32104172.21.249.521.2.840.113837.73102298.1540581278.61.2.392.200036.9116.2.6.1.3268.2046999618.1540534879.921419iSyntaxInitImageTQ=0&sid=b4be6021-d8af-41c2-a114-a35a7ee7cb78", "status"=\>409, "error"=\>{"type"=\>"version\_conflict\_engine\_exception", "reason"=\>"[doc][beta-32104172.21.249.521.2.840.113837.73102298.1540581278.61.2.392.200036.9116.2.6.1.3268.2046999618.1540534879.921419iSyntaxInitImageTQ=0&sid=b4be6021-d8af-41c2-a114-a35a7ee7cb78]: version conflict, current version [3] is different than the one provided [2]", "index\_uuid"=\>"yvM1Rv1qS0qXs-SB4YHnyw", "shard"=\>"0", "index"=\>"beta-2019-02"}}}}

my logstash output plugin is as below

if [uri\_query] and ![Server\_ElapsedMS] {  
elasticsearch {  
hosts =\> ["abcd:9200"]  
index =\> 'beta-%{+YYYY-MM}'  
action =\> "update"  
doc\_as\_upsert =\> true  
document\_id =\> "beta-%{ThreadID}%{SAHost}%{StudyUID}%{ImageInstanceUID}%{StudyAuthorityCallType}%{uri\_query}"  
}  
}  
if [uri\_query] and [Server\_ElapsedMS] {  
elasticsearch {  
hosts =\> ["abcd:9200"]  
index =\> 'beta-%{+YYYY-MM}'  
action =\> "update"  
doc\_as\_upsert =\> true  
document\_id =\> "beta-%{ThreadID}%{SAHost}%{StudyUID}%{ImageInstanceUID}%{StudyAuthorityCallType}%{uri\_query}"  
}  
}  
Can any one help out in resolving this.

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [February 13, 2019, 4:19pm UTC](https://discuss.elastic.co/t/logstash-upsert-usage/168244/2 "2019-02-13T16:19:07Z")

</div>

That message is not an error; it is a warning. If the behaviour is working as you expect (e.g., when the upsert is retried, a merge occurs), then you can ignore the warning.

---

<div class="post-metadata">

**Author:** ![manikandanid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manikandanid/32/91013_2.png) [@manikandanid](https://discuss.elastic.co/u/manikandanid)\
**Post date:** [February 13, 2019, 4:37pm UTC](https://discuss.elastic.co/t/logstash-upsert-usage/168244/3 "2019-02-13T16:37:39Z")

</div>

Thanks for the update. Is there any way i can prevent this message being logged. It fills up my log files almost...

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [February 15, 2019, 8:03pm UTC](https://discuss.elastic.co/t/logstash-upsert-usage/168244/4 "2019-02-15T20:03:09Z")

</div>

You might be looking for the [`failure_type_logging_whitelist => [409]`](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-failure_type_logging_whitelist) directive 🙂

---

<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:** [March 15, 2019, 8:03pm UTC](https://discuss.elastic.co/t/logstash-upsert-usage/168244/5 "2019-03-15T20:03:15Z")

</div>

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