I'm trying to import data from multiple database including mysql and sqlserver to es. With single JDBC it works just fine, but with multiple JDBC it doesn't work and gives no error message. Is this caused by using different driver at the sametime? The conf is
input {
jdbc {
jdbc_connection_string => "jdbc:mysql://localhost:3306/test?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true"
jdbc_user => "root"
jdbc_password => "password"
jdbc_driver_library => "C:\logstash-7.4.2\logstash-core\lib\mysql-connector-java-8.0.18.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
statement => "select * from blog_content WHERE update_date >= :sql_last_value"
schedule => "* * * * "
jdbc_default_timezone =>"Asia/Shanghai"
type=>"mysqltest"
}
jdbc {
jdbc_connection_string => "jdbc:sqlserver://127.0.0.1:1433;databaseName=logstashtest;"
jdbc_driver_library => "C:\logstash-7.4.2\logstash-core\lib\mssql-jdbc-6.2.2.jre8.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_user => "sa"
jdbc_password => "password"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
statement => "SELECT * FROM blog_content WHERE UpdateTime >= :sql_last_value"
schedule => " * * * *"
jdbc_default_timezone => "Asia/Shanghai"
type=>"sqlservertest"
}
}
output {
if[type] == "mysqltest" {
elasticsearch {
hosts => "127.0.0.1:9200"
index => "blogtest"
document_id => "%{id}"
}
}
if[type] == "sqlservertest" {
elasticsearch {
hosts => "127.0.0.1:9200"
index => "blogtest2"
document_id => "%{Gid}"
}
}
stdout {
codec => json_lines
}
}