I have problem with jdbc_driver_library.
ELK_VERSION = 6.4.2
And I use Docker for elk.
when i run:
/opt/logstash# bin/logstash --path.data=/opt/logstash/ -f /etc/logstash/conf.d/simple.conf
Get Error:
Error: org.postgresql.Driver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?
Exception: LogStash::ConfigurationError
Stack: /opt/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:163:inopen_jdbc_connection' /opt/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:221:in
execute_statement'
/opt/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:277:inexecute_query' /opt/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:263:in
run'
/opt/logstash/logstash-core/lib/logstash/pipeline.rb:409:ininputworker' /opt/logstash/logstash-core/lib/logstash/pipeline.rb:403:in
block in start_input'
^C[2018-11-08T08:07:23,329][WARN ][logstash.runner ] SIGINT received. Shutting down.
[2018-11-08T08:07:24,688][INFO ][logstash.pipeline ] Pipeline has terminated {:pipeline_id=>"main", :thread=>"#<Thread:0x40ce6e2c run>"}
^C[2018-11-08T08:07:26,309][FATAL][logstash.runner ] SIGINT received. Terminating immediately..
[2018-11-08T08:07:26,531][ERROR][org.logstash.Logstash ] org.jruby.exceptions.ThreadKill
simple.conf :
input {
jdbc {
type => "test"
jdbc_driver_library => "/etc/logstash/org.postgresql.jdbc4-8.3-603.jar"
jdbc_driver_class => "org.postgresql.Driver"
jdbc_connection_string => "jdbc:postgresql://xxxx:8080/dbname"
jdbc_user => "xxxxx"
jdbc_password => "xxxx"
jdbc_page_size => "50000"
record_last_run => true
#schedule => "*/5 * * * *"
###example statement
statement => "SELECT jj.id as id,
jjp.title as job,
FROM jobs AS jj
INNER JOIN jobs_job AS jjp ON jj.id=jjp.job_id
WHERE jj.active = true"}
}
path to jdbc_driver_library:
root@xxxxxxx:/etc/logstash# ls
conf.d mysql-connector-java-8.0.12.jar org.postgresql.jdbc4-8.3-603.jar
root@xxxxxxxxxx:/etc/logstash#
I do not understand why, because sometimes it works and sometimes does not work?