2

I configure logstash connection for oracle but not working.

Error: failed to load c:\ojdbc8.jar

Do you have any solution for this situation?

input {
  jdbc {
    jdbc_connection_string => "jdbc:oracle:thin:@192.168.10.10:1521/TESTDB"
    jdbc_user => "SCOTT"
    jdbc_password => "TIGER"
    #jdbc_validate_connection => true
    jdbc_driver_library => "C:\ojdbc8.jar"
    jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
    statement => "SELECT * FROM SALES_DATA_SAMPLE"

 }
}

output {
  elasticsearch {
    index => "salesdata"
    document_type => "salesdata"
    document_id => "%{uid}"
    hosts => "localhost:9200"
  }
}
Emre Sts
  • 95
  • 1
  • 6
  • Do you have the `ojdbc8.jar` located at the root of your `C:\`? – IanGabes Apr 02 '19 at 17:34
  • Yes I have. this is right path and file location "C:\ojdbc8.jar" But not load. – Emre Sts Apr 03 '19 at 06:00
  • Try with `C:/ojdbc8.jar`, the backslash might be an escape character. I found someone doing something similar here: https://discuss.elastic.co/t/logstash-mysql-using-jdbc-on-windows-library-error/37313 – IanGabes Apr 03 '19 at 17:13
  • Failed to load C:/ojdbc8.jar {:exception=>#} – Emre Sts Apr 05 '19 at 04:46
  • Your Logstash configuration looks fine to me.
    I have a configured logstash pipeline with an ojdbc6.jar driver and logstash6.5.3 working fine with configurations very similar to yours.
    Maybe you are having some compatibility issues. I found a similar issue [reported in github](https://github.com/logstash-plugins/logstash-input-jdbc/issues/331).
    – toomaas Apr 05 '19 at 10:47
  • Try giving the path as c:\\ojdbc8.jar and that should work – Nirmala Apr 09 '19 at 10:32
  • 1
    This is because it isn't Java 11 compatible, see https://github.com/logstash-plugins/logstash-input-jdbc/issues/331 – Alexander Hartmaier Apr 29 '19 at 10:15

1 Answers1

8

It's just a work around. Just copy the driver Jar file to /logstash-core/lib/jars/ directory.

Shrikant Wandhare
  • 2,301
  • 1
  • 9
  • 7