Logstash jdbc input output in one conf not working

Output works when input is not jdbc but this config ends in error:

[ERROR][org.logstash.Logstash ] java.lang.NoClassDefFoundError: Could not initialize class com.mysql.jdbc.PreparedStatement

conf:
'root@cloudcontrol-logstash:~# cat /etc/logstash/rrc104-production/docs/mysql-docs.conf
input {
jdbc {
jdbc_driver_library => "/usr/share/logstash/mysql-connector-java-5.1.43-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://35.227.67.170:3306/rrdb?&useSSL=false"
jdbc_user => "ffoti"
jdbc_password => "ffoti"
statement => "SELECT dr.document_name document_name,
d.document_id document_id,
d.matter_id matter_id,
3 doc_status_id,
d.duplicate_id duplicate_id,
dl.load_id load_id,
dl.load_status_id load_status_id
FROM document d,
document_load dl,
document_report dr
WHERE dl.load_id = d.load_id
AND d.document_id = dr.document_id
AND dr.status = 'Completed'
AND duplicate_id IS NULL"
jdbc_paging_enabled => "true"
jdbc_page_size => "500000"
}
}

filter {
mutate {
add_field => { "environment" => "rrc104-production" }
}
mutate {
add_field => { "customer_id" => "rrc104" }
}
mutate {
add_field => { "customer_name" => "BSF" }
}
mutate {
add_field => { "project" => "rrc104-219321" }
}
}

output {
elasticsearch {
hosts => [ "cloudcontrol-elasticsearch1.office.re.local:9200" ]
index => "mysql-docs"
ssl => true
cacert => '/etc/logstash/ca.crt'
sniffing => false
user => elastic
password => ra2tional3
}
}

output {
jdbc {
driver_jar_path => "/usr/share/logstash/mysql-connector-java-5.1.43-bin.jar"
driver_class => "com.mysql.jdbc.Driver"
connection_timeout => 50000
connection_string => "jdbc:mysql://10.200.2.163:3306/cloudcontrol?user=ffoti&password=ffoti&useSSL=false"
statement => ["INSERT INTO rrc104_prd_docs_mysql_l(matter_id,document_name,document_id,load_id,load_status_id) values(?,?,?,?,?)","matter_id","document_name","document_id","load_id","load_status_id"]
}
}
'

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