Start logstash with jdbc


(supermario) #1

I want to use logstash-input-jdbc in my logstash application on the windows. My jdk version is 1.8 , logstash version is 2.1 and use sqljdbc4.jar(version 4.2 or version 6.0).Logstash config :

input {
tcp
{
codec => "json"
type => "iis"
port => 5545
}
jdbc {
jdbc_driver_library => "C:\ELK\logstash\bin\sqljdbc42.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://localhost:1433/databasename=TuHUProduct"
jdbc_user => "sa"
jdbc_password=> "123456"
schedule => "* * * * *"
statement => "select * product"
}
}
output {
stdout{}
elasticsearch {
hosts => "127.0.0.1:9200"
}
}

When i start logstash with this config appear a exception:
This driver application don't support Java Runtime Environment (JRE) 1.8.Please use support for JDBC 4.0 sqljdbc4.jar .
My sqljdbc.jar is the lastest version (version 4.2 or version 6.0), i don't konw why this exception.
Please help, thanks.


(system) #2