The error info is [2018-03-19T23:03:15,552][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"riskcombbdata", :_type=>"eventdata", :_routing=>nil}, #<LogStash::Event:0x4df9660b>], :response=>{"index"=>{"_index"=>"riskcombbdata", "_type"=>"eventdata", "_id"=>"a2pcQWIBTNBnrTnHXqWR", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"mapper [nestedCalls.result.internalKeyValuePairs.be.score] of different type, current_type [text], merged_type [ObjectMapper]"}}}}
In Elasticsearch, a given field must be consistent in type across an entire index; Elasticsearch is rejecting your request because the field nestedCalls.result.internalKeyValuePairs.be.score is different than the current mapping, which was likely auto-detected from a previous document.
And I removed the field("_nestedCalls") in the filter of logstash.
So it seems like the problem now is the name of other fields.
For instance, "result.internalKeyValuePairs.be.score" and "result.internalKeyValuePairs.be.score.reason".
I did do the auto mappings in this scenarios.
But it threw the error like this,
[2018-03-20T02:31:13,219][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"riskcombdata", :_type=>"eventdata", :_routing=>nil}, #<LogStash::Event:0x229c1f41>], :response=>{"index"=>{"_index"=>"riskcombdata", "_type"=>"eventdata", "_id"=>"g2oaQmIBTNBnrTnHxKUi", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Can't merge a non object mapping [result.internalKeyValuePairs.be.score] with an object mapping [result.internalKeyValuePairs.be.score]"}}}}
I tried to rename "result.internalKeyValuePairs.be.score" to "result_internalKeyValuePairs_be_score" to avoid ES recognizing it as the object. What I want is just the name which is plain text, no other meaning. But it also threw me the error above.
When you have dots in field names these are expanded as in the example under the section 'Dots in Field Names'. This means that result.internalKeyValuePairs.be.score.reason will require result.internalKeyValuePairs.be.score to be mapped as an object. As every field name within an index, e.g. score, must have a single mapping, this clashes with result.internalKeyValuePairs.be.score, which higher up appears to be mapped to a float.
Replacing the dots in the field names with something else like you have tried should resolve the issue. can you show us the changes you made that did not work?
[2018-03-20T02:31:13,219][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"riskcombdata", :_type=>"eventdata", :_routing=>nil}, #<LogStash::Event:0x229c1f41>], :response=>{"index"=>{"_index"=>"riskcombdata", "_type"=>"eventdata", "_id"=>"g2oaQmIBTNBnrTnHxKUi", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Can't merge a non object mapping [result.internalKeyValuePairs.be.score] with an object mapping [result.internalKeyValuePairs.be.score]"}}}}
I guess if it is because of the sequence of those operations. Like the ingesting happens first and then renaming. What I thought before is the logtash did all mapping settings first and then ingest the data into elasticsearch. But yah, I have been stuck here for two days and have no ideas now:frowning:
Updated: I just deleted some conflict fields and keep the renaming command. It successfully ingested the data but it shows the renaming function did not work at all.
Updated: Problem solved!! It is the syntax of rename function... I think I followed the reference documents of the old version.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.