Java::oracle.jdbc.driver.OracleDriver not loaded in logstash-7.2.0

Hi,

I am using logstash-7.2.0. I want to export data from oracle to ES. I am having following configuration.

input {
jdbc{
 jdbc_driver_library => "C:/Pramod/rnd/ElasticSearch/logstash-7.2.0/ojdbc7.jar"
 jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
 jdbc_connection_string => "jdbc:oracle:thin:@//myOracleConnectionString:1521/GSEM4GE"
 jdbc_user => "APPS_GLOBAL"
 jdbc_password => "mypassword"
 statement => "SELECT * FROM all_tables"
 # schedule => "* * * * * * *"
 # where last_analysed>:sql_last_value
 # sql_last_value is for last updated value
}

}
output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "oracleinde"
}
stdout{
codec => rubydebug
}
}

when i am trying to execute this config file on command prompt it says "Java::oracle.jdbc.driver.OracleDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?".

Error: Java::oracle.jdbc.driver.OracleDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?
Exception: LogStash::ConfigurationError
Stack: C:/Pramod/rnd/ElasticSearch/logstash-7.2.0/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:163:in open_jdbc_connection' C:/Pramod/rnd/ElasticSearch/logstash-7.2.0/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:221:in execute_statement'
C:/Pramod/rnd/ElasticSearch/logstash-7.2.0/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:277:in execute_query' C:/Pramod/rnd/ElasticSearch/logstash-7.2.0/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:263:in run'
C:/Pramod/rnd/ElasticSearch/logstash-7.2.0/logstash-core/lib/logstash/java_pipeline.rb:309:in inputworker' C:/Pramod/rnd/ElasticSearch/logstash-7.2.0/logstash-core/lib/logstash/java_pipeline.rb:302:in block in start_input'

Pls help.

1 Like

I made some changes to the conf file. I kept jdbc_driver_library empty and put ojdbc7.jar file on /logstash-core/lib/jars/

input { jdbc{ jdbc_driver_library => "" jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver" jdbc_connection_string => "jdbc:oracle:thin:@//myOracleConnectionString:1521/GSEM4GE" jdbc_user => "APPS_GLOBAL" jdbc_password => "mypassword" statement => "SELECT * FROM all_tables" } } output { elasticsearch { hosts => ["http://localhost:9200"] index => "oracleindex" } stdout{ codec => rubydebug } }

This works for me.

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