I am newbie with elasticsearch(ES) and logstash. I have successfully setup elasticsearch and kibana using this link. After this I am trying to upload one table from sql server into ES using logstash. My logstash conf file is given below:
input {
jdbc {
clean_run => true
jdbc_driver_library => "/home/myusr/Downloads/sqljdbc_6.0/enu/jre8/sqljdbc42.jar"
jdbc_connection_string => "jdbc:sqlserver://xyz;databaseName=test;user=name;password=pass@123;"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_validate_connection => true
jdbc_user => "name"
jdbc_password => "pass@123"
statement => "SELECT top 10 * FROM mytable"
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "my_table"
}
}
On running this file I get:
[ERROR] 2021-07-16 18:13:55.567 [[main]<jdbc] jdbc - Unable to connect to database. Tried 1 times {:message=>"Java::JavaLang::NoClassDefFoundError: javax/xml/bind/DatatypeConverter", :exception=>Sequel::DatabaseConnectionError, :cause=>java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter, :backtrace=>["com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:4098)"
I have tried reinstallaing java8 after removing java11 version as suggested here. But it didn't work. I am not using any gradle or IDE to do --add-modules
to fix the issue. I'm following up this link but there's no solution as of yet. I have hit a roadblock with this. I have also checked this link. The only step that I didn't do here is the "Create Elasticsearch index with mapping". Is that the cause of the problem? How do I fix this issue?
Any help is appreciated.