i am using the below configuration.
input{
jdbc {
jdbc_connection_string => "jdbc:sqlserver:rpdidbtest.database.windows.net;databaseName=TEST_DB;integratedSecurity=false;user=;password=;"
jdbc_user => ""
jdbc_password => "*"
jdbc_driver_library => "../../../../etc/logstash/driver/sqljdbc_6.0/enu/jre8/sqljdbc42.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
# Shedule is once per hour or customise in cron type syntax
schedule => " * * * *"
statement => "SELECT * FROM dbo.CUSTOMERS"
# Uncomment and experiement for large tables
#jdbc_paging_enabled => true
#jdbc_page_size => 15000
#jdbc_fetch_size => 5000
}
}
output {
elasticsearch {
hosts => "localhost:9200"
index => "rpdi-lc-data"
document_type => "customers"
document_id => "%{ID}"
}
stdout {
codec => rubydebug
}
}
but getting connection error.
10:47:00.265 [Ruby-0-Thread-16: /usr/share/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:283] WARN logstash.inputs. jdbc - Exception when executing JDBC query {:exception=>#<Sequel::DatabaseConnectionError: Sequel::DatabaseError: driver.new.connect returned nil: probably ba d JDBC connection string>}
10:47:00.265 [Ruby-0-Thread-16: /usr/share/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:283] WARN logstash.inputs. jdbc - Attempt reconnection.
10:47:00.269 [Ruby-0-Thread-16: /usr/share/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:283] WARN logstash.inputs. jdbc - Failed test_connection.
{ 420476 rufus-scheduler intercepted an error:
420476 job:
420476 Rufus::Scheduler::CronJob "* * * * *" {}
420476 error:
420476 420476
420476 NoMethodError
420476 undefined method close_jdbc_connection' for #<Sequel::JDBC::Database:0x589530a1> 420476 /usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.2.0/lib/logstash/plugin_mixins/jdbc.rb:174:in
open_jdbc_connection'
420476 /usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.2.0/lib/logstash/plugin_mixins/jdbc.rb:247:in execute_statement' 420476 /usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.2.0/lib/logstash/inputs/jdbc.rb:272:in
execute_query'
420476 /usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.2.0/lib/logstash/inputs/jdbc.rb:250:in run' 420476 org/jruby/RubyProc.java:281:in
call'
420476 /usr/share/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:234:in do_call' 420476 /usr/share/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:258:in
do_trigger'
420476 /usr/share/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:300:in start_work_thread' 420476 org/jruby/RubyProc.java:281:in
call'
420476 /usr/share/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:299:in start_work_thread' 420476 org/jruby/RubyKernel.java:1479:in
loop'
420476 /usr/share/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:289:in `start_work_thread'