Hello everyone,
I transfer data from an elasticsearch to another elasticsearch with logstash.
I am using codec but could not solve the UTF problem.
My Config
elasticsearch {
codec => json {
charset => "UTF-16"
}
hosts => ["http://localhost:9200"]
index => "indexname"
user => "username"
password => "password"
}
}
filter {
mutate {
rename => { "fieldname" => "[newfieldname]" }
}
}
output {
elasticsearch {
hosts => ["http://localhost:9201"]
index => "sampleindex"
user => "username"
password => "password"
}
}
ERROR
[2020-02-04T15:01:56,574][WARN ][logstash.outputs.elasticsearch][main] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>"sdfsdcacascasdasd", :_index=>"sampleindex", :routing=>nil, :_type=>"_doc"}, #LogStash::Event:0x155796f5], :response=>{"index"=>{"_index"=>"sampleindex", "_type"=>"_doc", "_id"=>"sdfsdcacascasdasd", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"Illegal input [\u0000\u0000,] UTF-16 codepoint [0x0] at position 0 is a reserved character"}}}}}