您需要像这样修改您的logstash配置:
jdbc { jdbc_connection_string => "jdbc:mysql://myhostmachine:3306/mydb" jdbc_user => "root" jdbc_password => "root" jdbc_validate_connection => true jdbc_driver_library => "/mypath/mysql-connector-java-5.1.39-bin.jar" jdbc_driver_class => "com.mysql.jdbc.Driver" jdbc_paging_enabled => "true" jdbc_page_size => "50000" schedule => "* * * * *" statement => "SELECt * from TEST where id > :sql_last_value" use_column_value => true tracking_column => "id" tracking_column_type => "numeric" clean_run => true last_run_metadata_path => "/mypath/.logstash_jdbc_last_run" }在您的情况下,最后五个设置很重要。
.logstash_jdbc_last_run即使这样
clean_run => true做,也请确保删除该文件。



