Hi, I am running Logstash 5.6.4 with JDBC input with the following config:
input {
jdbc {
jdbc_driver_library => "/src/logstash-5.6.4/logstash-plugin-jdbc/ojdbc7-12.1.0.2.jar"
jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
jdbc_connection_string => "jdbc:oracle:thin:@x.x.x.x:x/name"
jdbc_user => "user"
jdbc_password => "password"
statement => "SELECT * FROM TABLE WHERE to_timestamp(DAY, 'YY.MM.DD') = to_timestamp(:sql_last_value,'YY.MM.DD') + NUMTODSINTERVAL(1,'day')"
#schedule => "5 * * * *"
last_run_metadata_path => "/app/script/.logstash_metadata"
tracking_column => "DAY"
use_column_value => true
}
}
output {
stdout {
codec => rubydebug { metadata => true }
}
}
When I run this code I get:
[2018-05-10T13:11:09,713][INFO ][logstash.pipeline ] Pipeline .monitoring-logstash started
[2018-05-10T13:11:09,726][INFO ][logstash.pipeline ] Starting pipeline {"id"=>"main", "pipeline.workers"=>1, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>125}
[2018-05-10T13:11:09,855][INFO ][logstash.pipeline ] Pipeline main started
[2018-05-10T13:11:09,933][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9611}
[2018-05-10T13:11:19,724][INFO ][logstash.inputs.metrics ] Monitoring License OK
[2018-05-10T13:11:42,837][INFO ][logstash.inputs.jdbc ] (32.126000s) SELECT * FROM TABLE WHERE to_timestamp(DAY, 'YY.MM.DD') = to_timestamp('18.05.02','YY.MM.DD') + NUMTODSINTERVAL(1,'day')
[2018-05-10T13:11:42,897][WARN ][logstash.agent ] stopping pipeline {:id=>".monitoring-logstash"}
[2018-05-10T13:11:44,620][WARN ][logstash.agent ] stopping pipeline {:id=>"main"}
It looks like the query has been made but I get no output.
Does anyone know why Logstash does not return output data? In SQL Server the query in bold gets results.
Best regards