Hello,
I am trying to poke my sql db to get only the updated values from the table using column ChangedAtas the tracking column with below configuration:
`input {
jdbc {
type => "actlock"
jdbc_connection_string => "jdbc:sqlserver://CXXXXXXX:1433;databaseName=dbname;integratedSecurity=false;"
# The path to our downloaded jdbc driver
jdbc_user => "xxxxxxx"
jdbc_password => "pwd"
jdbc_driver_library => "/usr/share/drivers/sqljdbc-4.0.jar"
#schedule => "*/5 * * * * *"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
statement => "SELECT * FROM [dbname].[dbo].[tablename] where ChangedAt> :sql_last_value"
use_column_value => true
tracking_column => "ChangedAt"
tracking_column_type => "timestamp"
last_run_metadata_path => "/var/log/logstash/.logstash_jdbc_last_run"
clean_run => true
}
}`
running above conf gives me error as below:
[ERROR][logstash.pipeline ] A plugin had an unrecoverable error. Will restart this plugin. Pipeline_id:main Plugin: <LogStash::Inputs::Jdbc jdbc_user=>"XXXXXX", last_run_metadata_path=>"/var/log/logstash/.logstash_jdbc_last_run", tracking_column_type=>"timestamp", type=>"actlock", use_column_value=>true, tracking_column=>"ChangedAt", jdbc_password=><password>, statement=>"SELECT * FROM [dbname].[dbo].[tablename] where ChangedAt> :sql_last_value", clean_run=>true, jdbc_driver_library=>"/usr/share/drivers/sqljdbc-4.0.jar", jdbc_connection_string=>"jdbc:sqlserver://XXXXXXXX:1433;databaseName=dbname;integratedSecurity=false;", id=>"4091f32f7dacc3fdc8e892394fabeb2b2a459241f4b832fb764a411a277d225e", jdbc_driver_class=>"com.microsoft.sqlserver.jdbc.SQLServerDriver", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_317e0ece-6d2d-4d74-b90c-bd088d8fe7c9", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validate_connection=>false, jdbc_validation_timeout=>3600, jdbc_pool_timeout=>5, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, parameters=>{"sql_last_value"=>1970-01-01 01:00:00 +0100}, record_last_run=>true, lowercase_column_names=>true> Error: com.microsoft.sqlserver.jdbc.SQLServerDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library? Exception: LogStash::ConfigurationError Stack: /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:163:in
open_jdbc_connection'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:221:in execute_statement' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:277:in
execute_query'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:263:in run' /usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:426:in
inputworker'
/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:420:in block in start_input'
Please help me to figure out where i am going wrong?