Logstash "doc_as_upsert" --> Error 404

Hi,

I'm trying to upgrade to logstash 2.x and can't figure out how to use the "upsert" correctly.
In my config I have:

output {
  elasticsearch {
        action => "update"
        doc_as_upsert => true
        document_id => "%{[myId]}"
        hosts => "localhost:9200"
        index =>  "myindex"
        document_type => "%{[_type]}"
        template_name => "mytemplate"
        template => "C:\\local\\repos\\logstash\\mytemplate.json"
        template_overwrite => "true"
        idle_flush_time => 0.3
    }
}

But when I try start logstash I get this error:

"Failed action. ", :status=>404, :action=>["update // content of the message // "status"=>404, "error"=>"DocumentMissingException[[myIndex][-1] [MESSAGE][f85c9ea2-3b13-47a1-9f33-5eb54f3a0e58]: document missing]"}}, :level=>:warn}

I thought that the document would be inserted if it does not exist yet?

1 Like