Logstash configuration file
input {
jdbc {
jdbc_validate_connection => true
jdbc_driver_library => "/etc/java-libs/mariadb-java-client-2.4.2.jar"
jdbc_driver_class => "Java::org.mariadb.jdbc.Driver"
jdbc_connection_string => "jdbc:mariadb://192.168.43.86:3306/test_database"
jdbc_user => "root"
jdbc_password => "mypass"
schedule => "*/1 * * * *"
statement => "SELECT * from logs"
sql_log_level => "debug"
record_last_run => true
last_run_metadata_path => "/etc/logstash/jdbc_last_run_metadata_path/mariadb"
}
}
output {
elasticsearch {
hosts => ["elasticsearch:9200"]
index => "mariadb-%{+YYYY.MM}"
}
}
Error
Pipeline_id:main
Plugin: <LogStash::Inputs::Jdbc jdbc_user=>"root", schedule=>"*/1 * * * *", last_run_metadata_path=>"/etc/logstash/jdbc_last_run_metadata_path/mariadb", jdbc_validate_connection=>true, jdbc_password=>, statement=>"SELECT * from logs", jdbc_driver_library=>"/etc/java-libs/mariadb-java-client-2.4.2.jar", jdbc_connection_string=>"jdbc:mariadb://192.168.43.86:3306/test_database", sql_log_level=>"debug", id=>"d87f5594d1055b9a122011e290769739601a307a1b549475fac60b43de8cc3a8", jdbc_driver_class=>"Java::org.mariadb.jdbc.Driver", record_last_run=>true, enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_ac92da5f-7dca-43be-ade0-1c27c98fc3cc", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validation_timeout=>3600, jdbc_pool_timeout=>5, connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, plugin_timezone=>"utc", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, lowercase_column_names=>true, use_prepared_statements=>false>
Error: unable to load /etc/java-libs/mariadb-java-client-2.4.2.jar from :jdbc_driver_library, file not readable (please check user and group permissions for the path)
Exception: LogStash::PluginLoadingError
Stack: /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.1/lib/logstash/plugin_mixins/jdbc/jdbc.rb:172:in block in load_driver_jars' org/jruby/RubyArray.java:1814:in
each'
/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.1/lib/logstash/plugin_mixins/jdbc/jdbc.rb:167:in load_driver_jars' /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.1/lib/logstash/plugin_mixins/jdbc/jdbc.rb:148:in
load_driver'
/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.1/lib/logstash/inputs/jdbc.rb:273:in run' /usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:328:in
inputworker'
/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:320:in `block in start_input'
[2020-05-19T14:09:32,037][ERROR][logstash.javapipeline ][main] A plugin had an unrecoverable error. Will restart this plugin.
Please help me with the proper solution