# Logstash output failed action

**URL:** <https://discuss.elastic.co/t/logstash-output-failed-action/168246>\
**Category:** Logstash\
**Created:** [February 13, 2019, 3:01pm UTC](https://discuss.elastic.co/t/logstash-output-failed-action/168246 "2019-02-13T15:01:23Z")\
**Posts on this page:** 2\
**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, 3:01pm UTC](https://discuss.elastic.co/t/logstash-output-failed-action/168246/1 "2019-02-13T15:01:23Z")

</div>

I am trying to merge two document based on a common information in the document. Using the doc\_as\_upsert option for this. My logstash config is

if [uri\_query] and ![Server\_ElapsedMS] {  
elasticsearch {  
hosts =\> ["abcd:9200"]  
index =\> 'beta-%{+YYYY-MM}'  
action =\> "update"  
doc\_as\_upsert =\> true  
document\_id =\> "beta-%{comp1}%{comp2}%{comp3}%{comp4}%{comp5}%{comp6}"  
}  
}  
else if [uri\_query] and [Server\_ElapsedMS] {  
elasticsearch {  
hosts =\> ["abcd:9200"]  
index =\> 'beta-%{+YYYY-MM}'  
action =\> "update"  
doc\_as\_upsert =\> true  
document\_id =\> "beta-%{comp1}%{comp2}%{comp3}%{comp4}%{comp5}%{comp6}"  
}  
}

Following is the error i get in logstash logs

[2019-02-13T09:17:59,563][WARN][logstash.outputs.elasticsearch] Failed action. {:status=\>409, :action=\>["update", {:\_id=\>"beta-271162.16.840.1.114151.10181811386601901181.2.840.113681.2887585702.1549638557.4400.510574ComponentByNameCS=262144&OS=11272192&sid=c9414b41-3f19-4568-9f6a-b8b4e90b6f53", :\_index=\>"beta-2019-02", :\_type=\>"doc", :\_routing=\>nil, :\_retry\_on\_conflict=\>1}, #LogStash::Event:0x22987f34], :response=\>{"update"=\>{"\_index"=\>"beta-2019-02", "\_type"=\>"doc", "\_id"=\>"beta-271162.16.840.1.114151.10181811386601901181.2.840.113681.2887585702.1549638557.4400.510574ComponentByNameCS=262144&OS=11272192&sid=c9414b41-3f19-4568-9f6a-b8b4e90b6f53", "status"=\>409, "error"=\>{"type"=\>"version\_conflict\_engine\_exception", "reason"=\>"[doc][beta-271162.16.840.1.114151.10181811386601901181.2.840.113681.2887585702.1549638557.4400.510574ComponentByNameCS=262144&OS=11272192&sid=c9414b41-3f19-4568-9f6a-b8b4e90b6f53]: version conflict, document already exists (current version [1])", "index\_uuid"=\>"yvM1Rv1qS0qXs-SB4YHnyw", "shard"=\>"0", "index"=\>"beta-2019-02"}}}}

I understand that the id exists, but the action i have given is update so it should go ahead and update to ES. Am i wrong here ?

---

<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 13, 2019, 3:07pm UTC](https://discuss.elastic.co/t/logstash-output-failed-action/168246/2 "2019-03-13T15:07:57Z")

</div>

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