gpt4 book ai didi

logstash - Logstash JDBC 上的 SQL 语句 |如何仅过滤今天插入的行?

转载 作者:行者123 更新时间:2023-12-04 01:35:34 24 4
gpt4 key购买 nike

在我的 oracle 数据库中,我有一列 insert_date。在 elasticsearch 上,我只想索引今天插入的事件。这是我的 session :

       jdbc {
type => "D"
jdbc_connection_string => "jdbc:oracle:thin:@//xxx.xx.xx.xx:1521/xx"
jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
jdbc_user => "xxx"
jdbc_password => "xx"
statement => "select * from mytable where insert_date = TRUNC(SYSDATE) order by insert_date desc"
schedule => "0 * * * * *"
clean_run => true
last_run_metadata_path => "/data/application/.logstash_jdbc_last_run"
}

我运行此脚本但在 logstash 上不断收到错误。

最佳答案

你能试试下面的查询吗?

Select * from mytable where insert_date > 
sysdate-24/24 order by insert_date

关于logstash - Logstash JDBC 上的 SQL 语句 |如何仅过滤今天插入的行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59716169/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com