Logstash JDBC上的SQL语句|如何仅在今天进行筛选';插入的行是什么?

Logstash JDBC上的SQL语句|如何仅在今天进行筛选';插入的行是什么?,logstash,Logstash,在我的oracle数据库中,我有一列insert_date。在elasticsearch上,我只想索引今天插入的事件。 这是我的配置文件: jdbc { type => "D" jdbc_connection_string => "jdbc:oracle:thin:@//xxx.xx.xx.xx:1521/xx" jdbc_driver_class => "Java::oracle.jdbc.

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

       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"
            }

我运行此脚本,但在日志存储中不断出现错误。

您可以尝试下面的查询吗

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