Logstash Version: 7.1
错误提示
Java::JavaSql::SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';) AS `t1` LIMIT 1' at line 1: SELECT count(*) AS `count` FROM (SELECT * FROM oss_map;) AS `t1` LIMIT 1
配置文件如下:
input {
jdbc {
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/miniolayer"
jdbc_user => "root"
jdbc_password => "123456"
# schedule => " * * * * * *"
clean_run => true
use_column_value => true
tracking_column => "id"
statement => "SELECT * FROM oss_map;"
jdbc_page_size => 2
jdbc_paging_enabled => true
}
}
output {
stdout { codec => rubydebug }
# stdout { codec => json_lines }
}
原因是 statement => "SELECT * FROM oss_map;"
语句后有;
,去除这个;
就可以正常执行