Hi All,
I was using an earlier version of Logstash (5.*) and reading data from a DB2 instance with no issues using the following input params
input {
jdbc {
jdbc_connection_string => "jdbc:db2://...URL"
jdbc_user => "user"
jdbc_password => "pass"
jdbc_driver_library => "/usr/share/logstash/jdbc_lib/db2jcc4.jar"
jdbc_driver_class => "com.ibm.db2.jcc.DB2Driver"
statement => "select * from ..."
}
................
After upgrading to Logstash 6.2.2, this no more works and throws an exception:
[2018-03-14T14:08:13,752][ERROR][logstash.pipeline ] A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::Jdbc jdbc_connection_string=>"jdbc:db2:....", jdbc_user=>"DB2INST1", jdbc_password=>, jdbc_driver_library=>"/usr/share/logstash/jdbc_lib/db2jcc4.jar", jdbc_driver_class=>"com.ibm.db2.jcc.DB2Driver", statement=>"select * ...", id=>"220461e62489d47a8983ece494545cebee2133442d8a65e3131ae7ff537d394c", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_e96d7f96-9fac-4769-b744-3bcccc7122ae", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validate_connection=>false, jdbc_validation_timeout=>3600, jdbc_pool_timeout=>5, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, parameters=>{"sql_last_value"=>2018-03-14 16:48:54 UTC}, last_run_metadata_path=>"/root/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true>
Error: com.ibm.db2.jcc.DB2Driver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?
Exception: LogStash::ConfigurationError
Stack: /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.3/lib/logstash/plugin_mixins/jdbc.rb:159:in open_jdbc_connection' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.3/lib/logstash/plugin_mixins/jdbc.rb:227:inexecute_statement'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.3/lib/logstash/inputs/jdbc.rb:271:in execute_query' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.3/lib/logstash/inputs/jdbc.rb:256:inrun'
/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:516:in `inputworker'
Note that the earlier and current Logstash instances could access and query tables from a MySQL and a PostgreSQL instances with no problems (and their jar files are in the same path as the DB2 jar file), so the issue seems DB2 specific. Also note that I tried adding a DB2 license file as follows, but that did not make any difference:
jdbc_driver_library=>"/usr/share/logstash/jdbc_lib/db2jcc4.jar,/usr/share/logstash/jdbc_lib/db2jcc_license_cu.jar"
Any feedback is appreciated. Any examples on using Logstash 6.2.* with DB2 are appreciated, too.
Regards.