That error could occur when the output is not compatible with the target Elasticsearch index mappings. You may check the output is what you desired using stdout output plugin.
output {
stdout { codec => rubydebug }
}
If you would share the output and what is the desired output, it will be easier to debug the pipeline. And also it could be caused by the lack of the last mutate filter @Badger shared, resulting that output filter plugin containing original (unparsed) "payload" field.
[2022-02-13T21:20:31,234][WARN ][logstash.outputs.elasticsearch][main][ccad6cd3409188a6dd4fe75a73d50d6e92db14a4768c7a636041e969cbd8eb12] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"type9", :routing=>nil}, {"payload"=>"[{\"isHeadingHome\":0,\"isRelocalizing\":0,\"state\":3,\"stateStr\":\"Idle\",\"status\":1,\"statusStr\":\"Docked\"}]", "@version"=>"1", "environment"=>"production", "timestamp"=>1644787048349, "tags"=>["_split_type_failure"], "dataType"=>9, "deviceId"=>"114", "@timestamp"=>2022-02-13T21:17:28.349Z, "zoneId"=>31, "payloadJson"=>[{"statusStr"=>"Docked", "isHeadingHome"=>0, "status"=>1}]}], :response=>{"index"=>{"_index"=>"type9", "_type"=>"_doc", "_id"=>"klX19H4B6euHrZDSaS_E", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"object mapping for [payload] tried to parse field [payload] as object, but found a concrete value"}}}}
What I am tryting to achieve is simply to split the array into single documents.
See this answer for a discussion of mapping exceptions and how to fix them
The error is pointing at {"payload"=>"[{\"isHeadingHome\":0,. The [payload] field is a string, and Elasticsearch expects it to be an object. Note that the event has a _split_type_failure tag. It may OK that payloadJson is an object -- that's not causing an error.
That Elasticsearch index error was caused by that the "payload" field of the output was a string.
In addition, you have to cope with _split_type_failure tag. It occurs when you use split filter on fields other than string or array.
the output does not seems to be the result of the shared conf file. There should be some more filters that might cause the error&failure. I wonder if the _split_type_failure came from another split filter. When you share the whole pipeline, somebody could check.
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.