Created
March 15, 2023 08:52
-
-
Save diloabininyeri/88da4872782bf64763d86a6038cec5ec to your computer and use it in GitHub Desktop.
logstash input mysql and output mysql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
jdbc { | |
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/database_name" | |
jdbc_user => "admin" | |
jdbc_password => "admin" | |
jdbc_driver_library => "/home/log-stash/drivers/mysql-connector-java-8.0.25.jar" | |
jdbc_driver_class => "com.mysql.jdbc.Driver" | |
statement => "SELECT * FROM my_table_input WHERE id > :sql_last_value ORDER BY id ASC limit 1" | |
tracking_column => "id" | |
tracking_column_type => "numeric" | |
use_column_value => true | |
schedule => "* * * * * *" | |
} | |
} | |
output { | |
stdout{ | |
} | |
jdbc{ | |
driver_jar_path => "/home/log-stash/drivers/mysql-connector-java-8.0.25.jar" | |
driver_class => "com.mysql.jdbc.Driver" | |
connection_string => "jdbc:mysql://127.0.0.1:3306/database_name" | |
username => "admin" | |
password =>"admin" | |
statement => ["replace into my_table_output (id,name,created_at,updated_at) values (?,?,?,?)","id","name","created_at","updated_at"] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
should install jdbc out via
https://github.com/theangryangel/logstash-output-jdbc