logstash部分配置jdbc{
jdbc_connection_string => "jdbc:oracle:thin:@//*********/***"
jdbc_user => "***"
jdbc_password => "****"
jdbc_validate_connection => true
jdbc_driver_library => "/elk/logstash-6.4.0/bin/logstash_conf/ojdbc6.jar"
jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
statement_filepath => "/elk/logstash-6.4.0/bin/logstash_conf/****.sql"
schedule => "*/10 * * * *"
last_run_metadata_path => "/elk/logstash-6.4.0/bin/logstash_conf/****.txt"
}
定时十分钟执行一次,但实际执行时间是乱的,下面是部分日志打印的执行sql
[2019-06-14T08:14:51,537][INFO ][logstash.inputs.jdbc ] (1780.162546s) select **** from * t
where t.is_audit = 1 and (t.release_time >=TIMESTAMP '2019-06-14 07:08:06.139675 +08:00' or t.update_time >=TIMESTAMP '2019-06-14 07:08:06.139675 +08:00')
[2019-06-14T08:24:18,388][INFO ][logstash.inputs.jdbc ] (566.724597s) select **** from * t
where t.is_audit = 1 and (t.release_time >=TIMESTAMP '2019-06-14 07:45:11.372854 +08:00' or t.update_time >=TIMESTAMP '2019-06-14 07:45:11.372854 +08:00')
[2019-06-14T08:43:46,121][INFO ][logstash.inputs.jdbc ] (1167.674314s) select **** from * t
where t.is_audit = 1 and (t.release_time >=TIMESTAMP '2019-06-14 08:14:51.661771 +08:00' or t.update_time >=TIMESTAMP '2019-06-14 08:14:51.661771 +08:00')
[2019-06-14T08:45:02,836][INFO ][logstash.inputs.jdbc ] (76.646696s) select **** from * t
where t.is_audit = 1 and (t.release_time >=TIMESTAMP '2019-06-14 08:24:18.446500 +08:00' or t.update_time >=TIMESTAMP '2019-06-14 08:24:18.446500 +08:00')
[2019-06-14T08:48:08,126][INFO ][logstash.inputs.jdbc ] (103.991700s) select **** from *t
where t.is_audit = 1 and (t.release_time >=TIMESTAMP '2019-06-14 08:43:46.187685 +08:00' or t.update_time >=TIMESTAMP '2019-06-14 08:43:46.187685 +08:00')
[2019-06-14T08:48:48,647][INFO ][logstash.inputs.jdbc ] (2.713949s) select **** from * t
where t.is_audit = 1 and (t.release_time >=TIMESTAMP '2019-06-14 08:46:24.133435 +08:00' or t.update_time >=TIMESTAMP '2019-06-14 08:46:24.133435 +08:00')
jdbc_connection_string => "jdbc:oracle:thin:@//*********/***"
jdbc_user => "***"
jdbc_password => "****"
jdbc_validate_connection => true
jdbc_driver_library => "/elk/logstash-6.4.0/bin/logstash_conf/ojdbc6.jar"
jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
statement_filepath => "/elk/logstash-6.4.0/bin/logstash_conf/****.sql"
schedule => "*/10 * * * *"
last_run_metadata_path => "/elk/logstash-6.4.0/bin/logstash_conf/****.txt"
}
定时十分钟执行一次,但实际执行时间是乱的,下面是部分日志打印的执行sql
[2019-06-14T08:14:51,537][INFO ][logstash.inputs.jdbc ] (1780.162546s) select **** from * t
where t.is_audit = 1 and (t.release_time >=TIMESTAMP '2019-06-14 07:08:06.139675 +08:00' or t.update_time >=TIMESTAMP '2019-06-14 07:08:06.139675 +08:00')
[2019-06-14T08:24:18,388][INFO ][logstash.inputs.jdbc ] (566.724597s) select **** from * t
where t.is_audit = 1 and (t.release_time >=TIMESTAMP '2019-06-14 07:45:11.372854 +08:00' or t.update_time >=TIMESTAMP '2019-06-14 07:45:11.372854 +08:00')
[2019-06-14T08:43:46,121][INFO ][logstash.inputs.jdbc ] (1167.674314s) select **** from * t
where t.is_audit = 1 and (t.release_time >=TIMESTAMP '2019-06-14 08:14:51.661771 +08:00' or t.update_time >=TIMESTAMP '2019-06-14 08:14:51.661771 +08:00')
[2019-06-14T08:45:02,836][INFO ][logstash.inputs.jdbc ] (76.646696s) select **** from * t
where t.is_audit = 1 and (t.release_time >=TIMESTAMP '2019-06-14 08:24:18.446500 +08:00' or t.update_time >=TIMESTAMP '2019-06-14 08:24:18.446500 +08:00')
[2019-06-14T08:48:08,126][INFO ][logstash.inputs.jdbc ] (103.991700s) select **** from *t
where t.is_audit = 1 and (t.release_time >=TIMESTAMP '2019-06-14 08:43:46.187685 +08:00' or t.update_time >=TIMESTAMP '2019-06-14 08:43:46.187685 +08:00')
[2019-06-14T08:48:48,647][INFO ][logstash.inputs.jdbc ] (2.713949s) select **** from * t
where t.is_audit = 1 and (t.release_time >=TIMESTAMP '2019-06-14 08:46:24.133435 +08:00' or t.update_time >=TIMESTAMP '2019-06-14 08:46:24.133435 +08:00')
0 个回复