SQL 关于 Logstash 的声明 JDBC |如何仅过滤今天插入的行?
SQL Statement on Logstash JDBC | How do i filter only on the today's inserted rows?
在我的 oracle 数据库中有一列 insert_date。在 elasticsearch 上,我只想索引今天插入的事件。
这是我的会议:[=13=]
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
在我的 oracle 数据库中有一列 insert_date。在 elasticsearch 上,我只想索引今天插入的事件。 这是我的会议:[=13=]
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