logstash 官方论坛关于 track_time 值的回复
版本 7.6.2 mac系统下同样遇到了 track_time 不变的问题,即使我修改为 update_time > :sql_last_value ,依然时间依然不会前进。


截图中可以看出,分别是22:22分和22:23分执行的两次,两次的条件都是 update_time > '2020-09-01 06:45:38' 继续执行,这个值依然不会增加。
logstash 官方论坛中,之前版本也出现过同样的问题。被采纳的回复中说:
When you set use_column_value => true then sql_last_value becomes the value of the tracking column from each record as it is processed and the last record wins (and is persisted). In this case make sure that the query has an ORDER BY insert_time clause. Make sure that you have a field called insert_time in your SELECT clause. Surely not all insert_time values are "2017-01-01 00:00:00.000000000 Z"?.
When you set it to false then the sql_last_value becomes a timestamp taken at the time just before the query is run and that value is persisted at the end of the run.
回复中建议使用order by解决此问题。
请问老师,是否可以使用 order by 解决此问题,使用order by 会不会出现一些新的问题呢
正在回答
之前有个同学在公司电脑上无法更新追踪时间,使用order by解决。后来他回家后重新部署了一下,没使用order by,神奇了,可以更新tracktime了。
关于该问题有一部分同学出现。一部分没有出现。推测也是官方的小bug,追加order by吧,哈哈哈
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星