input {
stdin {
}
jdbc {
# mysql jdbc connection string to our backup databse
jdbc_connection_string => "jdbc:mysql://**"
# the user we wish to excute our statement as
jdbc_user => "**"
jdbc_password => "**"
# the path to our downloaded jdbc driver
jdbc_driver_library => "lib\mysql-connector-java-5.1.40-bin.jar"
# the name of the driver class for mysql
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
statement_filepath => "jdbc.sql"
schedule => "* 8 * * *"
type => "jdbc"
}
jdbc {
# mysql jdbc connection string to our backup databse
jdbc_connection_string => "jdbc:mysql://**"
# the user we wish to excute our statement as
jdbc_user => "**"
jdbc_password => "**"
# the path to our downloaded jdbc driver
jdbc_driver_library => "lib\mysql-connector-java-5.1.40-bin.jar"
# the name of the driver class for mysql
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
statement_filepath => "jdbc1.sql"
schedule => "* 8 * * *"
type => "jdbc1"
}
}
filter {
json {
source => "message"
remove_field => ["message"]
}
}
output {
if[type] == "jdbc" {
elasticsearch {
hosts => ["localhost:9200"]
index => "mysql01"
document_id => "%{id}"
}
}
if[type] == "jdbc1" {
elasticsearch {
hosts => ["localhost:9200"]
index => "mysql02"
document_id => "%{id}"
}
}
stdout {
codec => json_lines
}
}
stdin {
}
jdbc {
# mysql jdbc connection string to our backup databse
jdbc_connection_string => "jdbc:mysql://**"
# the user we wish to excute our statement as
jdbc_user => "**"
jdbc_password => "**"
# the path to our downloaded jdbc driver
jdbc_driver_library => "lib\mysql-connector-java-5.1.40-bin.jar"
# the name of the driver class for mysql
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
statement_filepath => "jdbc.sql"
schedule => "* 8 * * *"
type => "jdbc"
}
jdbc {
# mysql jdbc connection string to our backup databse
jdbc_connection_string => "jdbc:mysql://**"
# the user we wish to excute our statement as
jdbc_user => "**"
jdbc_password => "**"
# the path to our downloaded jdbc driver
jdbc_driver_library => "lib\mysql-connector-java-5.1.40-bin.jar"
# the name of the driver class for mysql
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
statement_filepath => "jdbc1.sql"
schedule => "* 8 * * *"
type => "jdbc1"
}
}
filter {
json {
source => "message"
remove_field => ["message"]
}
}
output {
if[type] == "jdbc" {
elasticsearch {
hosts => ["localhost:9200"]
index => "mysql01"
document_id => "%{id}"
}
}
if[type] == "jdbc1" {
elasticsearch {
hosts => ["localhost:9200"]
index => "mysql02"
document_id => "%{id}"
}
}
stdout {
codec => json_lines
}
}