Always getting this error while trying to index using logstash
[2018-12-28T10:39:45,549][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"myindex-1", :_type=>"mytype-1", :_routing=>nil}, #LogStash::Event:0x92accdb], :response=>{"index"=>{"_index"=>"myindex-1", "_type"=>"mytype-1", "_id"=>"O4U382cBllSAv7rY4_NB", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Can't merge a non object mapping [doc.xref.scenarios.scenario.examplesTable.tableTransformers.transformers] with an object mapping [doc.xref.scenarios.scenario.examplesTable.tableTransformers.transformers]
Logstash config
The # character at the beginning of a line indicates a comment. Use
comments to describe your configuration.
input {
file
{
codec => multiline {
pattern => '^{'
negate => true
what => previous
max_lines => 200000
}
type => "json"
path => "D:/TestElasticSearch/xref.json"
start_position => "beginning"
sincedb_path => "/null"
}
}
filter{
mutate
{
replace => [ "message", "%{message}}}" ]
gsub => [ 'message','\n','']
}
mutate{
remove_field => ["[xref][scenarios]"]
}
if [message] =~ /^{.*}$/
{
json
{ source => "message"
target => "parsedJson"
}
}
mutate {
add_field => {
"Story" => "%{[parsedJson][xref][stories][0][story][name]}"
}
}
mutate{
remove_field => ["message"]
}
if "_jsonparsefailure" in [tags] {
drop { }
}
}
output {
stdout { codec => rubydebug }
elasticsearch {
hosts => "localhost:9200"
user => "elastic"
password => "changeme"
index => "myindex-5"
document_type => "mytype-5"
}
}
Using Dynamic Mapping Of Elastic Search . Please guide .
Thanks .