How to connect to Sybase SQL Anywhere with JDBC plugin

Hello!
I need to import data from Sybase SQL Anywhere 17 to Logstash.
How can I do it?

I was going to point you to the jdbc input plugin but it seems you've already found it. What are you having difficulties with? The more concrete your question is the greater are your chances of getting help.

I have problem with Logstash JDBC input plugin for SQL Anywhere:

My system is :

SQL Anywhere 17

Centos 7 (centos-release-7-3.1611.el7.centos.x86_64)
ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-linux]
Java:
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b12)
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)

logstash 5.4.0

Logstash conf file:

input {
jdbc {
jdbc_connection_string => "jdbc:sqlanywhere://host:port/DB_NAME"
jdbc_user => "user"
jdbc_password => "password"
jdbc_validate_connection => true
jdbc_driver_library => "/usr/share/logstash/jconn3.jar"
jdbc_driver_class => "com.sybase.jdbc3.jdbc.SybDriver"
schedule => "00 15 * * *"
statement => "SELECT User_ID, User_Name, Tenant_ID, Cluster_ID FROM ads_user"
}
}
output {
elasticsearch {
index => "ads_user_data"
document_type => "ads_user"
document_id => "%{User_ID}"
hosts => ["localhost:9200"]
}
}

Rezult from the log file:

:error=>"NoMethodError: undefined method `new' for #Array:0x2807bd49"}

Error registering plugin {:plugin=>"<LogStash::Inputs::Jdbc jdbc_connection_string=>"jdbc:sqlanywhere://host:port/DB_NAME", jdbc_user=>"user", jdbc_password=>, jdbc_validate_connection=>true, jdbc_driver_library=>"/usr/share/logstash/jconn3.jar", jdbc_driver_class=>"com.sybase.jdbc3.jdbc.SybDriver", schedule=>"00 15 * * *", statement=>"SELECT User_ID, User_Name, Tenant_ID, Cluster_ID FROM ads_user", id=>"c60edd68b511d76cc50eae57ee60a6b6b0c47057-13", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_7adfcbcf-b27f-4e1f-8cc4-9e4b5179f098", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validation_timeout=>3600, jdbc_pool_timeout=>5, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, last_run_metadata_path=>"/usr/share/logstash/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true>", :error=>"NoMethodError: undefined method `new' for #Array:0x2807bd49"}

Pipeline aborted due to error {:exception=>#<Sequel::DatabaseConnectionError: NoMethodError: undefined method new' for #<Array:0x2807bd49>>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.43.0/lib/sequel/adapters/jdbc.rb:222:inconnect'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.43.0/lib/sequel/connection_pool.rb:116:in make_new'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.43.0/lib/sequel/connection_pool/threaded.rb:228:inmake_new'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.43.0/lib/sequel/connection_pool/threaded.rb:201:in available'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.43.0/lib/sequel/connection_pool/threaded.rb:137:in_acquire'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.43.0/lib/sequel/connection_pool/threaded.rb:151:in acquire'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.43.0/lib/sequel/connection_pool/threaded.rb:282:insync'", "org/jruby/ext/thread/Mutex.java:149:in synchronize'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.43.0/lib/sequel/connection_pool/threaded.rb:282:insync'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.43.0/lib/sequel/connection_pool/threaded.rb:150:in acquire'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.43.0/lib/sequel/extensions/connection_validator.rb:98:inacquire'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.43.0/lib/sequel/connection_pool/threaded.rb:106:in hold'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.43.0/lib/sequel/database/connecting.rb:285:insynchronize'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/sequel-4.43.0/lib/sequel/database/connecting.rb:295:in test_connection'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.3/lib/logstash/plugin_mixins/jdbc.rb:171:inprepare_jdbc_connection'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.3/lib/logstash/inputs/jdbc.rb:191:in register'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:268:inregister_plugin'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:279:in register_plugins'", "org/jruby/RubyArray.java:1613:ineach'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:279:in register_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:429:instart_inputs'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:323:in start_workers'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:214:inrun'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:398:in `start_pipeline'"]}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.