Logtash issue while inserting data


(Saineshwar Bageri) #1

elastic search new version "elasticsearch-6.2.4" and logstash version "logstash-6.2.4".

I am pushing data from SQL server to elastic search 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".


(Saineshwar Bageri) #2

The issue has been resolved.

The issue was that I have already created index and then

I was trying to push data from Logstash into the same index

which it was creating an issue.

I have delete index which I had created now logstash inserting data works fine.


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.