Elasticsearch new version "elasticsearch-6.2.4" and logstash version "logstash-6.2.4".
I am pushing data from SQL server to Elasticsearch using logstash.
Getting Error.
[2018-05-29T23:55:19,493][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index",
{:_id=>nil,
:_index=>"humanresources", :_type=>"doc", :_routing=>nil}, #LogStash::Event:0x22a9c104], :response=>{"index"=>{"_index"=>"humanresources", "_type"=
"doc", "_id"=>"uV0lrWMBmPP2pmTTqIpx", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Rejecting mapping update to [humanres
ources] as the final mapping would have more than 1 type: [doc, employee]"}}}}
config file
input {
jdbc {
jdbc_driver_library => "D:\sqljdbc_6.4.0.0_enu\sqljdbc_6.4\enu\mssql-jdbc-6.4.0.jre8.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://SAI;user=sa;password=#####;"
jdbc_user => "sa"
jdbc_password => "#####"
statement => "SELECT * FROM [AdventureWorks2008R2].[HumanResources].[Employee]"
}
}
filter {
}
output {
stdout { codec => json_lines }
elasticsearch {
hosts => "http://localhost:9200"
index => "humanresources"
}
}
I have already create index with name "humanresources" and i have type "employee".