# Issue while connecting to Sql server using losgtash

**URL:** <https://discuss.elastic.co/t/issue-while-connecting-to-sql-server-using-losgtash/119043>\
**Category:** Logstash\
**Created:** [February 8, 2018, 12:53pm UTC](https://discuss.elastic.co/t/issue-while-connecting-to-sql-server-using-losgtash/119043 "2018-02-08T12:53:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahesh\_Kumar](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@Mahesh\_Kumar](https://discuss.elastic.co/u/Mahesh_Kumar)\
**Post date:** [February 8, 2018, 12:53pm UTC](https://discuss.elastic.co/t/issue-while-connecting-to-sql-server-using-losgtash/119043/1 "2018-02-08T12:53:28Z")

</div>

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:in`adapter\_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:in`connect'  
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:in`loop'  
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:in`open\_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:in`execute\_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:in`inp  
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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 8, 2018, 12:58pm UTC](https://discuss.elastic.co/t/issue-while-connecting-to-sql-server-using-losgtash/119043/2 "2018-03-08T12:58:40Z")

</div>

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