我是靠谱客的博主 激动衬衫,这篇文章主要介绍Logstash input jdbc分页异常,现在分享给大家,希望可以做个参考。

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;" 语句后有;,去除这个;就可以正常执行

最后

以上就是激动衬衫最近收集整理的关于Logstash input jdbc分页异常的全部内容,更多相关Logstash内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(123)

评论列表共有 0 条评论

立即
投稿
返回
顶部