Logstash with Jdbc input plugin error

I am tring to connect mysql workbench 6.3 CE with logstash via jdbc plugin but i am having error which i am unable to figure out research on it but found no fix so that is why i am posting it here.

OS: Windows 10

Logstash Config file

input {
      jdbc { 
        jdbc_driver_library => "c:/mysql-connector-java-8.0.16.jar"
        jdbc_driver_class => "com.mysql.jdbc.Driver"
        jdbc_connection_string => "jdbc:mysql://localhost:3306/bestpricedb1?user=root&password=12345678"
        jdbc_user => "root"
    	statement => "SELECT * FROM visited_stores"
        }
      }

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

Error i am getting
C:/logstash/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:/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:277:inexecute_query'
C:/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:263:in run' C:/logstash/logstash-core/lib/logstash/java_pipeline.rb:297:ininputworker'
C:/logstash/logstash-core/lib/logstash/java_pipeline.rb:290:in `block in start_input'
[2019-05-11T10:37:29,239][ERROR][logstash.inputs.jdbc ] Failed to load c:/mysql-connector-java-8.0.16.jar {:exception=>#<TypeError: failed to coerce jdk.internal.loader.ClassLoaders$AppClassLoader to java.net.URLClassLoader>}
[2019-05-11T10:37:29,242][ERROR][logstash.javapipeline ] A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::Jdbc jdbc_user=>"root", statement=>"SELECT * FROM visited_stores", jdbc_driver_library=>"c:/mysql-connector-java-8.0.16.jar", jdbc_connection_string=>"jdbc:mysql://localhost:3306/bestpricedb1?user=root&password=12345678", id=>"6f33b5f49281a1bbb802689a1e7d04766aea9e5c90d7a9802c2d154ad5347cf2", jdbc_driver_class=>"com.mysql.jdbc.Driver", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_f86d0811-0452-4843-b9e0-6c322fabb8fb", 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"=>1970-01-01 00:00:00 UTC}, last_run_metadata_path=>"C:\Users\Hp/.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.mysql.jdbc.Driver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?
Exception: LogStash::ConfigurationError

Tried version of jdbc_driver_library
mysql-connector-java-5.1.36
mysql-connector-java-5.1.44-bin.jar
mysql-connector-java-8.0.16.jar

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