I am getting the below error from logstash, when trying to insert a document -
ERROR ->
14:58:11.352 [[main]>worker0] WARN logstash.outputs.elasticsearch - Failed action. {:status=>500, :action=>["index", {:_id=>"TKT2000735", :_index=>"helpnow_ticket_finance", :_type=>"ticket", :_routing=>nil, :pipeline=>"attach_pipeline_finance"}, 2017-08-07T05:37:26.669Z INBENGHIMAN2408 %{message}], :response=>{"index"=>{"_index"=>"helpnow_ticket_finance", "_type"=>"ticket", _id"=>"TKT2000735", "status"=>500, "error"=>{"type"=>"exception", "reason"=>"java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: [AttachmentSet] is not an integer, cannot be used as an index as part of path [TicketItemSet.AttachmentSet]", "caused_by"=>{"type"=>"illegal_argument_exception", reason"=>"java.lang.IllegalArgumentException: [AttachmentSet] is not an integer, cannot be used as an index as part of path [TicketItemSet.AttachmentSet]", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"[AttachmentSet] is not an integer, cannot be used as an index as part of path [TicketItemSet.AttachmentSet]", "caused_by"=>{"type"=>"number_format_exception", "reason"=>"For input string: "AttachmentSet""}}}, "header"=>{"processor_type"=>"foreach"}}}}}
Data looks something like ->
{
"Description": "conf test",
"document_type": "ticket",
"TicketItemSet": [{
"AttachmentSet": [{
"AttachmentData": "VGhpcyBpcyBhIHRlc3QK",
}],
}],
}
It is working normally as per the example provided on ES website, probably because the field is at the root level, and in my case it is one level down the root.
Please help.