推送最后 updated_on 日期的数据
push data from the last updated_on date
所以我在我的 jdbc logstash 输入中使用以下查询。
statement => "SELECT * from mydata WHERE updated_on > :sql_last_value ORDER BY updated_on"
use_column_value =>true
tracking_column =>updated_on
tracking_column_type => "@timestamp"
或
statement => "SELECT * from mydata WHERE :sql_last_value > updated_on ORDER BY updated_on"
use_column_value =>true
tracking_column =>updated_on
tracking_column_type => "@timestamp"
这里,我的 :sql_last 值被认为是配置文件的最后 运行 时间。
示例:
"updated_on": "2019-09-26T08:11:00.000Z",
"@timestamp": "2019-09-26T08:17:52.974Z"
这里我的sql_last_value对应@timestamp,
我希望它改为考虑 updated_on。
我如何更改它以考虑最后 updated_on 日期而不是执行时间?
所以这是 :
statement => "SELECT * from agedata WHERE updated_on > :sql_last_value ORDER BY updated_on"
use_column_value => true
tracking_column => updated_on
tracking_column_type => "timestamp"
它说的基本上是 sql_last_value
变量将 store/remember 来自最后一个 运行 的 updated_on
列的最后一个值,因为 use_column_value
是true
(不是您建议的最后一个 运行 时间值,否则 use_column_value
将是 false
)。
所以您的配置已经达到了您的预期。
所以我在我的 jdbc logstash 输入中使用以下查询。
statement => "SELECT * from mydata WHERE updated_on > :sql_last_value ORDER BY updated_on"
use_column_value =>true
tracking_column =>updated_on
tracking_column_type => "@timestamp"
或
statement => "SELECT * from mydata WHERE :sql_last_value > updated_on ORDER BY updated_on"
use_column_value =>true
tracking_column =>updated_on
tracking_column_type => "@timestamp"
这里,我的 :sql_last 值被认为是配置文件的最后 运行 时间。 示例:
"updated_on": "2019-09-26T08:11:00.000Z",
"@timestamp": "2019-09-26T08:17:52.974Z"
这里我的sql_last_value对应@timestamp, 我希望它改为考虑 updated_on。
我如何更改它以考虑最后 updated_on 日期而不是执行时间?
所以这是
statement => "SELECT * from agedata WHERE updated_on > :sql_last_value ORDER BY updated_on"
use_column_value => true
tracking_column => updated_on
tracking_column_type => "timestamp"
它说的基本上是 sql_last_value
变量将 store/remember 来自最后一个 运行 的 updated_on
列的最后一个值,因为 use_column_value
是true
(不是您建议的最后一个 运行 时间值,否则 use_column_value
将是 false
)。
所以您的配置已经达到了您的预期。