Issue while connecting to Sql server using losgtash


(Mahesh Kumar) #1

I am trying to index data in elastic search using logstash from SQL server DB and iam getting this following error

Error: undefined method to_sym' for nil:NilClass Did you mean? to_s Exception: NoMethodError Stack: C:/LogTash/logstash-6.1.3/vendor/bundle/jruby/2.3.0/gems/sequel-5.4 ib/sequel/database/connecting.rb:17:inadapter_class'
C:/LogTash/logstash-6.1.3/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/se
/database/connecting.rb:36:in connect' C:/LogTash/logstash-6.1.3/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/se /core.rb:116:inconnect'
C:/LogTash/logstash-6.1.3/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc
.3/lib/logstash/plugin_mixins/jdbc.rb:112:in block in jdbc_connect' org/jruby/RubyKernel.java:1292:inloop'
C:/LogTash/logstash-6.1.3/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc
.3/lib/logstash/plugin_mixins/jdbc.rb:109:in jdbc_connect' C:/LogTash/logstash-6.1.3/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc .3/lib/logstash/plugin_mixins/jdbc.rb:161:inopen_jdbc_connection'
C:/LogTash/logstash-6.1.3/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc
.3/lib/logstash/plugin_mixins/jdbc.rb:227:in execute_statement' C:/LogTash/logstash-6.1.3/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc .3/lib/logstash/inputs/jdbc.rb:271:inexecute_query'
C:/LogTash/logstash-6.1.3/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc
.3/lib/logstash/inputs/jdbc.rb:256:in run' C:/LogTash/logstash-6.1.3/logstash-core/lib/logstash/pipeline.rb:524:ininp
rker'
C:/LogTash/logstash-6.1.3/logstash-core/lib/logstash/pipeline.rb:517:in `blo

And this is my config file

input {
jdbc
{
jdbc_connection_string=>"*********"
jdbc_user=>"user"
jdbc_password=>"PW"
jdbc_driver_library=>"C:/LogTash/logstash-6.1.3/bin/sqljdbc_6.2/enu/mssql-jdbc-6.2.2.jre8.jar"
jdbc_driver_class=>"com.microsoft.sqlserver.jdbc.SQLServerDriver"
statement=>"use ***** select top 10 * from ****"
}

}

output
{
elasticsearch
{
hosts=>"localhost"
index=>"indexnae"
document_type=>"usermessagesnew"
}
stdout
{}
}

Thanks in advance


(system) #2

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