高峰只对攀登它而不是仰望它的人来说才有真正意义。

logsatash同步mysql数据到es数据丢失

Logstash | 作者 Erin | 发布于2020年12月01日 | 阅读数:2501

系统 : ubuntu
mysql:8.0
es 7.6.2
logstash  7.6.2
 
使用的是增量方式同步

字段数据丢失,有的才会出现,不知道为什么会出现这种情况
 

Screenshot_from_2020-11-30_21-53-05.png



这是我的配置文件
 
input {
jdbc {
jdbc_driver_library => "/media/tina/UNTITLED/software/es/logstash-7.6.2/myconfig/mysql-connector-java-8.0.16.jar"
jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://192.168.3.26:3306/tina_flowers?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true"
jdbc_user => "root"
jdbc_password => "123456"
schedule => "* * * * *"
# select * from flowers WHERE edit_time > :sql_last_value
statement => "SELECT id,title,flowers_desc,cover,flowers_img,origin_price,sell_price,discount,like_num,limit_num,options,total_sales,month_sales,praise_rate,status,add_time,edit_time,stock FROM flowers WHERE edit_time >= :sql_last_value and edit_time<GETDATE()"
jdbc_validate_connection=>true
}
}



output{
elasticsearch {
hosts => ["localhost:19200"]
index => "tina_index"
document_id => "%{id}"
}
stdout { codec => rubydebug }

}
已邀请:

要回复问题请先登录注册