# SQL Server data to Elasticsearch using LogStash

**URL:** https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488
**Category:** Logstash
**Created:** [August 18, 2020, 7:45pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488 "2020-08-18T19:45:09Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)
#### Post date: [August 18, 2020, 7:45pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/1 "2020-08-18T19:45:09Z")

</div>

HI

I am tryting to integrate the Sql server data to Elasticsearch with Logstash in my local machine.

I am using the Microsoft Sql Server 2019 and jdbc using the below

-- **Microsoft JDBC Driver 4.2 for SQL Server**

This is my sample config file.

input {

jdbc {

```
jdbc_driver_library => "C:\Program Files\Microsoft SQL Server\sqljdbc_4.2\enu\jre8\sqljdbc42.jar"

jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"

jdbc_connection_string => "jdbc:sqlserver://localhost;integratedSecurity=true;"

jdbc_data => "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\" 

jdbc_log => "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\"

jdbc_Backup => "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Backup"

jdbc_user => "DESKTOP-2M19H9R\kogan"

#jdbc_password => "pwd"

#servername => "DESKTOP-2M19H9R"

statement => "SELECT * FROM Persons"

```

}

}

output {

elasticsearch {

```
hosts => "localhost:9200"

index => "cs_users"

```

}

}

when i am running this getting the below error. Please help me.

Error: com.microsoft.sqlserver.jdbc.SQLServerDriver not loaded. :jdbc\_driver\_library is not set, are you sure you included the proper driver client libraries in your classpath?  
Exception: LogStash::PluginLoadingError  
Stack: C:/elastic\_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.5/lib/logstash/plugin\_mixins/jdbc/common.rb:36:in `load_driver' C:/elastic_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.5/lib/logstash/inputs/jdbc.rb:275:in `run'  
C:/elastic\_stack/logstash-7.8.1/logstash-core/lib/logstash/java\_pipeline.rb:374:in `inputworker' C:/elastic_stack/logstash-7.8.1/logstash-core/lib/logstash/java_pipeline.rb:365:in `block in start\_input'  
[2020-08-18T15:12:15,745][WARN][logstash.runner] SIGINT received. Shutting down.  
[2020-08-18T15:12:17,922][INFO][logstash.javapipeline] Pipeline terminated {"pipeline.id"=\>"main"}  
[2020-08-18T15:12:18,007][INFO][logstash.runner] Logstash shut down.

* * *

C:\elastic\_stack\logstash-7.8.1\>logstash -f sql.conf

Sending Logstash logs to C:/elastic\_stack/logstash-7.8.1/logs which is now configured via log4j2.properties  
[2020-08-18T15:28:20,147][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[2020-08-18T15:28:20,266][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"7.8.1", "jruby.version"=\>"jruby 9.2.11.1 (2.5.7) 2020-03-25 b1f55b1a40 Java HotSpot(TM) 64-Bit Server VM 25.261-b12 on 1.8.0\_261-b12 +indy +jit [mswin32-x86\_64]"}  
[2020-08-18T15:28:21,045][INFO][logstash.config.source.local.configpathloader] No config files found in path {:path=\>"C:/elastic\_stack/logstash-7.8.1/sql.conf"}  
[2020-08-18T15:28:21,072][ERROR][logstash.config.sourceloader] No configuration found in the configured sources.  
[2020-08-18T15:28:21,492][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
[2020-08-18T15:28:26,443][INFO][logstash.runner] Logstash shut down.

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [August 19, 2020, 12:09am UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/2 "2020-08-19T00:09:43Z")

</div>

> [@sukumar.koganti](#):
>
> `C:\Program Files\Microsoft SQL Server\sqljdbc_4.2\enu\jre8\sqljdbc42.jar`

I'd start by verifying this file is located in this folder and the naming is all correct.

---

<div class="post-metadata">

### Author: ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)
#### Post date: [August 19, 2020, 2:08am UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/3 "2020-08-19T02:08:30Z")

</div>

Yes aaron, the file naming is all correct.  
thanks for replying.

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [August 19, 2020, 2:32am UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/4 "2020-08-19T02:32:28Z")

</div>

Not sure if this is the issue but try moving your `sqljdbc42.jar` to `logstash-core/lib/jars/' and you can remove 'jdbc_driver_library` parameter.

---

<div class="post-metadata">

### Author: ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)
#### Post date: [August 19, 2020, 2:36pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/5 "2020-08-19T14:36:56Z")

</div>

Yes aaron i did the same as you suggested even though it's failing.

with the below error. i have the actual log which created on log folder "C:\elastic\_stack\logstash-7.8.1\logs"

[2020-08-19T10:19:18,951][INFO][logstash.setting.writabledirectory] Creating directory {:setting=\>"path.queue", :path=\>"C:/elastic\_stack/logstash-7.8.1/data/queue"}  
[2020-08-19T10:19:19,085][INFO][logstash.setting.writabledirectory] Creating directory {:setting=\>"path.dead\_letter\_queue", :path=\>"C:/elastic\_stack/logstash-7.8.1/data/dead\_letter\_queue"}  
[2020-08-19T10:19:19,220][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[2020-08-19T10:19:19,231][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"7.8.1", "jruby.version"=\>"jruby 9.2.11.1 (2.5.7) 2020-03-25 b1f55b1a40 Java HotSpot(TM) 64-Bit Server VM 25.261-b12 on 1.8.0\_261-b12 +indy +jit [mswin32-x86\_64]"}  
[2020-08-19T10:19:19,290][INFO][logstash.agent] No persistent UUID file found. Generating new UUID {:uuid=\>"286aa382-bfb4-453a-8074-182a08dc1fe3", :path=\>"C:/elastic\_stack/logstash-7.8.1/data/uuid"}  
[2020-08-19T10:19:19,916][INFO][logstash.config.source.local.configpathloader] No config files found in path {:path=\>"C:/elastic\_stack/logstash-7.8.1/sample.conf"}  
[2020-08-19T10:19:19,964][ERROR][logstash.config.sourceloader] No configuration found in the configured sources.  
[2020-08-19T10:19:20,559][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
[2020-08-19T10:19:25,331][INFO][logstash.runner] Logstash shut down.  
[2020-08-19T10:26:48,277][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[2020-08-19T10:26:48,395][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"7.8.1", "jruby.version"=\>"jruby 9.2.11.1 (2.5.7) 2020-03-25 b1f55b1a40 Java HotSpot(TM) 64-Bit Server VM 25.261-b12 on 1.8.0\_261-b12 +indy +jit [mswin32-x86\_64]"}  
[2020-08-19T10:26:49,086][INFO][logstash.config.source.local.configpathloader] No config files found in path {:path=\>"C:/elastic\_stack/logstash-7.8.1/sql.conf"}  
[2020-08-19T10:26:49,116][ERROR][logstash.config.sourceloader] No configuration found in the configured sources.  
[2020-08-19T10:26:49,516][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
[2020-08-19T10:26:54,488][INFO][logstash.runner] Logstash shut down.

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [August 19, 2020, 2:51pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/6 "2020-08-19T14:51:06Z")

</div>

> [@sukumar.koganti](#):
>
> logstash -f sql.conf

You are running the above and it's can't find that file. Is that file in the config folder? If so you would do the below.

```auto
logstash -f config/sql.conf

```

---

<div class="post-metadata">

### Author: ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)
#### Post date: [August 19, 2020, 2:55pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/7 "2020-08-19T14:55:48Z")

</div>

Yes i ran the above command, it;s giving me like this

C:\Users\kogan\Documents\Talend\>cd C:\elastic\_stack\logstash-7.8.1\config

C:\elastic\_stack\logstash-7.8.1\config\>logstash -f config/sql.conf  
Sending Logstash logs to C:/elastic\_stack/logstash-7.8.1/logs which is now configured via log4j2.properties  
[2020-08-19T10:54:31,186][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[2020-08-19T10:54:31,300][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"7.8.1", "jruby.version"=\>"jruby 9.2.11.1 (2.5.7) 2020-03-25 b1f55b1a40 Java HotSpot(TM) 64-Bit Server VM 25.261-b12 on 1.8.0\_261-b12 +indy +jit [mswin32-x86\_64]"}  
[2020-08-19T10:54:31,857][INFO][logstash.config.source.local.configpathloader] No config files found in path {:path=\>"C:/elastic\_stack/logstash-7.8.1/config/config/sql.conf"}  
[2020-08-19T10:54:31,873][ERROR][logstash.config.sourceloader] No configuration found in the configured sources.  
[2020-08-19T10:54:32,410][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
[2020-08-19T10:54:37,356][INFO][logstash.runner] Logstash shut down.

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [August 19, 2020, 3:00pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/8 "2020-08-19T15:00:49Z")

</div>

> [@sukumar.koganti](#):
>
> C:/elastic\_stack/logstash-7.8.1/config/config/sql.conf

It was looking for that file and couldn't find it. So you were probably inside the config folder when you ran the command. Go back one folder and run it.

Or use the absolute path.

```auto
logstash -f C:\elastic_stack\logstash-7.8.1\config\sql.conf

```

Either way look at the error and see where it is trying to find the sql.conf file and adjust.

---

<div class="post-metadata">

### Author: ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)
#### Post date: [August 19, 2020, 3:54pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/9 "2020-08-19T15:54:20Z")

</div>

Here it is after ran the above path. i think there is problem with my laogstash i guess

C:\elastic\_stack\logstash-7.8.1\config\>logstash -f C:\elastic\_stack\logstash-7.8.1\config\sql.conf  
Sending Logstash logs to C:/elastic\_stack/logstash-7.8.1/logs which is now configured via log4j2.properties  
[2020-08-19T11:28:42,051][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[2020-08-19T11:28:42,163][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"7.8.1", "jruby.version"=\>"jruby 9.2.11.1 (2.5.7) 2020-03-25 b1f55b1a40 Java HotSpot(TM) 64-Bit Server VM 25.261-b12 on 1.8.0\_261-b12 +indy +jit [mswin32-x86\_64]"}  
[2020-08-19T11:28:44,334][INFO][org.reflections.Reflections] Reflections took 62 ms to scan 1 urls, producing 21 keys and 41 values  
[2020-08-19T11:28:44,594][ERROR][logstash.inputs.jdbc] Unknown setting 'jdbc\_Login' for jdbc  
[2020-08-19T11:28:44,596][ERROR][logstash.inputs.jdbc] Unknown setting 'jdbc\_server' for jdbc  
[2020-08-19T11:28:44,605][ERROR][logstash.agent] Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:main, :exception=\>"Java::JavaLang::IllegalStateException", :message=\>"Unable to configure plugins: (ConfigurationError) Something is wrong with your configuration.", :backtrace=\>["org.logstash.config.ir.CompiledPipeline.(CompiledPipeline.java:119)", "org.logstash.execution.JavaBasePipelineExt.initialize(JavaBasePipelineExt.java:80)", "org.logstash.execution.JavaBasePipelineExt$INVOKER$i$1$0$initialize.call(JavaBasePipelineExt$INVOKER$i$1$0$initialize.gen)", "org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:837)", "org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:1169)", "org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuperSplatArgs(IRRuntimeHelpers.java:1156)", "org.jruby.ir.targets.InstanceSuperInvokeSite.invoke(InstanceSuperInvokeSite.java:39)", "C\_3a\_.elastic\_stack.logstash\_minus\_7\_dot\_8\_dot\_1.logstash\_minus\_core.lib.logstash.java\_pipeline.RUBY$method$initialize$0(C:/elastic\_stack/logstash-7.8.1/logstash-core/lib/logstash/java\_pipeline.rb:44)", "org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:82)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:70)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:332)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:86)", "org.jruby.RubyClass.newInstance(RubyClass.java:939)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)", "org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:207)", "C\_3a\_.elastic\_stack.logstash\_minus\_7\_dot\_8\_dot\_1.logstash\_minus\_core.lib.logstash.pipeline\_action.create.RUBY$method$execute$0(C:/elastic\_stack/logstash-7.8.1/logstash-core/lib/logstash/pipeline\_action/create.rb:52)", "C\_3a\_.elastic\_stack.logstash\_minus\_7\_dot\_8\_dot\_1.logstash\_minus\_core.lib.logstash.pipeline\_action.create.RUBY$method$execute$0$ **VARARGS** (C:/elastic\_stack/logstash-7.8.1/logstash-core/lib/logstash/pipeline\_action/create.rb)", "org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:82)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:70)", "org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:207)", "C\_3a\_.elastic\_stack.logstash\_minus\_7\_dot\_8\_dot\_1.logstash\_minus\_core.lib.logstash.agent.RUBY$block$converge\_state$2(C:/elastic\_stack/logstash-7.8.1/logstash-core/lib/logstash/agent.rb:356)", "org.jruby.runtime.CompiledIRBlockBody.callDirect(CompiledIRBlockBody.java:138)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:58)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:52)", "org.jruby.runtime.Block.call(Block.java:139)", "org.jruby.RubyProc.call(RubyProc.java:318)", "org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:105)", "java.lang.Thread.run(Unknown Source)"]}  
warning: thread "Converge PipelineAction::Create" terminated with exception (report\_on\_exception is true):  
LogStash::Error: Don't know how to handle `Java::JavaLang::IllegalStateException` for `PipelineAction::Create<main>`  
create at org/logstash/execution/ConvergeResultExt.java:129  
add at org/logstash/execution/ConvergeResultExt.java:57  
converge\_state at C:/elastic\_stack/logstash-7.8.1/logstash-core/lib/logstash/agent.rb:369  
[2020-08-19T11:28:44,618][ERROR][logstash.agent] An exception happened when converging configuration {:exception=\>LogStash::Error, :message=\>"Don't know how to handle `Java::JavaLang::IllegalStateException` for `PipelineAction::Create<main>`"}  
[2020-08-19T11:28:44,667][FATAL][logstash.runner] An unexpected error occurred! {:error=\>#\<LogStash::Error: Don't know how to handle `Java::JavaLang::IllegalStateException` for `PipelineAction::Create<main>`\>, :backtrace=\>["org/logstash/execution/ConvergeResultExt.java:129:in `create'", "org/logstash/execution/ConvergeResultExt.java:57:in `add'", "C:/elastic\_stack/logstash-7.8.1/logstash-core/lib/logstash/agent.rb:369:in `block in converge\_state'"]}  
[2020-08-19T11:28:44,683][ERROR][org.logstash.Logstash] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

C:\elastic\_stack\logstash-7.8.1\config\>

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [August 19, 2020, 4:02pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/10 "2020-08-19T16:02:35Z")

</div>

> [@sukumar.koganti](#):
>
> [2020-08-19T11:28:44,594][ERROR][logstash.inputs.jdbc] Unknown setting 'jdbc\_Login' for jdbc  
> [2020-08-19T11:28:44,596][ERROR][logstash.inputs.jdbc] Unknown setting 'jdbc\_server' for jdbc

Now you are running the config and you are seeing errors within your .conf file. Can you post your input section and we can start going through that?

---

<div class="post-metadata">

### Author: ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)
#### Post date: [August 19, 2020, 4:08pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/11 "2020-08-19T16:08:55Z")

</div>

Sure, here it is my Input Section.

input {

jdbc {

```
jdbc_driver_library => "C:/Users/kogan/Downloads/Microsoft JDBC Driver 7.4 for SQL/sqljdbc_7.4/enu"

#Placed my mssql-jdbc-7.4.1.jre8 JRE file in logstash ..\logstash-core\lib\jars\

jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"

jdbc_connection_string => "jdbc:sqlserver://localhost;integratedSecurity=true;"

jdbc_server => "DESKTOP-2M19H9R"

jdbc_Login => "Dell_Canada"

jdbc_password => "Dell123$"

statement => "SELECT * FROM dbo.student"

```

}

}

output {

elasticsearch {

```
hosts => "localhost:9200"

index => "cs_users"

```

}

}

Since i have installed SQL Server locally for practice purpose to achieve it.

Thanks,

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [August 19, 2020, 4:14pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/12 "2020-08-19T16:14:19Z")

</div>

Start by heading to the [documentation](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#plugins-inputs-jdbc-options) and reading the parameters. See which ones are required and make sure you use those.

The errors you saw above were because those parameters do not exist. `jdbc_Login and jdbc_server`. Use the default example they give as a template.

```auto
input {
  jdbc {
    jdbc_driver_library => "mysql-connector-java-5.1.36-bin.jar"
    jdbc_driver_class => "com.mysql.jdbc.Driver"
    jdbc_connection_string => "jdbc:mysql://localhost:3306/mydb"
    jdbc_user => "mysql"
    schedule => "* * * * *"
    statement => "SELECT * from songs where artist = :favorite_artist"
  }
}

```

---

<div class="post-metadata">

### Author: ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)
#### Post date: [August 19, 2020, 4:23pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/13 "2020-08-19T16:23:06Z")

</div>

Yes aaron, after i remove those now it's little bit progress.

Error: unable to load C:/Users/kogan/Downloads/Microsoft JDBC Driver 7.4 for SQL/sqljdbc\_7.4/enu from :jdbc\_driver\_library, no such file to load -- C:/Users/kogan/Downloads/Microsoft JDBC Driver 7.4 for SQL/sqljdbc\_7.4/enu  
Exception: LogStash::PluginLoadingError  
Stack: C:/elastic\_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.5/lib/logstash/plugin\_mixins/jdbc/common.rb:53:in `block in load_driver_jars' org/jruby/RubyArray.java:1809:in `each'  
C:/elastic\_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.5/lib/logstash/plugin\_mixins/jdbc/common.rb:42:in `load_driver_jars' C:/elastic_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.5/lib/logstash/plugin_mixins/jdbc/common.rb:25:in `load\_driver'  
C:/elastic\_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.5/lib/logstash/inputs/jdbc.rb:275:in `run' C:/elastic_stack/logstash-7.8.1/logstash-core/lib/logstash/java_pipeline.rb:374:in `inputworker'  
C:/elastic\_stack/logstash-7.8.1/logstash-core/lib/logstash/java\_pipeline.rb:365:in `block in start\_input'

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [August 19, 2020, 4:26pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/14 "2020-08-19T16:26:45Z")

</div>

> [@sukumar.koganti](#):
>
> Error: unable to load C:/Users/kogan/Downloads/Microsoft JDBC Driver 7.4 for SQL/sqljdbc\_7.4/enu from :jdbc\_driver\_library, no such file to load -- C:/Users/kogan/Downloads/Microsoft JDBC Driver 7.4 for SQL/sqljdbc\_7.4/enu

Great. Now move on to your next error. Your config is telling Logstash the JDBC driver is located in a spot where it is not. The file should end in .jar extension. So I would locate where this driver is on your file system then update your Logstash configuration to reflect where it is.

---

<div class="post-metadata">

### Author: ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)
#### Post date: [August 19, 2020, 4:38pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/15 "2020-08-19T16:38:54Z")

</div>

Yes i have changed the conf file. and my driver is in the below path.

**C:\elastic\_stack\logstash-7.8.1\logstash-core\lib\jars**  
--\> mssql-jdbc-7.4.1.jre8

C:\Users\kogan\Downloads\Microsoft JDBC Driver 7.4 for SQL\sqljdbc\_7.4\enu ( This is my actual jar file is located) ## Do i need to add this path into environment varible.

java.lang.Thread.run(java/lang/Thread)  
[2020-08-19T12:32:23,985][ERROR][logstash.inputs.jdbc][main][c80f35693d0afd349d49ffa60545a56f9c563b28971f5513a47676a66972ced9] Unable to connect to database. Tried 1 times {:error\_message=\>"Java::ComMicrosoftSqlserverJdbc::SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:b3c0edb7-3260-4439-8735-c23cfc05fff8"}  
[2020-08-19T12:32:23,989][ERROR][logstash.javapipeline][main][c80f35693d0afd349d49ffa60545a56f9c563b28971f5513a47676a66972ced9] A plugin had an unrecoverable error. Will restart this plugin.  
Pipeline\_id:main  
Plugin: \<LogStash::Inputs::Jdbc jdbc\_user=\>"Dell\_Canada", jdbc\_password=\>, statement=\>"SELECT \* FROM dbo.student", jdbc\_connection\_string=\>"jdbc:sqlserver://localhost;integratedSecurity=true;", id=\>"c80f35693d0afd349d49ffa60545a56f9c563b28971f5513a47676a66972ced9", jdbc\_driver\_class=\>"com.microsoft.sqlserver.jdbc.SQLServerDriver", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_1d18b17f-40fe-41df-8b26-4bda3c7898a2", 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, plugin\_timezone=\>"utc", last\_run\_metadata\_path=\>"C:\Users\kogan/.logstash\_jdbc\_last\_run", use\_column\_value=\>false, tracking\_column\_type=\>"numeric", clean\_run=\>false, record\_last\_run=\>true, lowercase\_column\_names=\>true, use\_prepared\_statements=\>false\>  
Error: Java::ComMicrosoftSqlserverJdbc::SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:b3c0edb7-3260-4439-8735-c23cfc05fff8  
Exception: Sequel::DatabaseConnectionError  
Stack: com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:2924)

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [August 19, 2020, 4:41pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/16 "2020-08-19T16:41:54Z")

</div>

> [@sukumar.koganti](#):
>
> [2020-08-19T12:32:23,985][ERROR][logstash.inputs.jdbc][main][c80f35693d0afd349d49ffa60545a56f9c563b28971f5513a47676a66972ced9] Unable to connect to database. Tried 1 times {:error\_message=\>"Java::ComMicrosoftSqlserverJdbc::SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:b3c0edb7-3260-4439-8735-c23cfc05fff8"}

This is saying the driver you are using can't use `integrated authentication`. Try removing that part from your `jdbc_connection_string`.

`jdbc_connection_string => "jdbc:sqlserver://localhost;"`

---

<div class="post-metadata">

### Author: ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)
#### Post date: [August 19, 2020, 4:48pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/17 "2020-08-19T16:48:34Z")

</div>

Should i put only this

jdbc\_connection\_string =\> "integratedSecurity=true;"

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [August 19, 2020, 4:51pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/18 "2020-08-19T16:51:11Z")

</div>

If you open your SQL Server it should tell you what the connection string is. But to answer your question, no. That is the part you want to remove.

---

<div class="post-metadata">

### Author: ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)
#### Post date: [August 19, 2020, 5:40pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/19 "2020-08-19T17:40:35Z")

</div>

I have changed the connection string.. and here it is

**jdbc\_connection\_string =\> "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Dell"**

Error: bad URI(is not URI?): Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=true;Initial Catalog=Dell  
Exception: URI::InvalidURIError  
Stack: uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/uri/rfc3986\_parser.rb:67:in `split' uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/uri/rfc3986_parser.rb:73:in `parse'  
uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/uri/common.rb:237:in `parse' C:/elastic_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/sequel-5.34.0/lib/sequel/database/connecting.rb:34:in `connect'  
C:/elastic\_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/sequel-5.34.0/lib/sequel/core.rb:125:in `connect' C:/elastic_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.5/lib/logstash/plugin_mixins/jdbc/jdbc.rb:114:in `block in jdbc\_connect'  
org/jruby/RubyKernel.java:1442:in `loop' C:/elastic_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.5/lib/logstash/plugin_mixins/jdbc/jdbc.rb:111:in `jdbc\_connect'  
C:/elastic\_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.5/lib/logstash/plugin\_mixins/jdbc/jdbc.rb:139:in `open_jdbc_connection' C:/elastic_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.5/lib/logstash/plugin_mixins/jdbc/jdbc.rb:197:in `execute\_statement'  
C:/elastic\_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.5/lib/logstash/inputs/jdbc.rb:316:in `execute_query' C:/elastic_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.5/lib/logstash/inputs/jdbc.rb:284:in `run'  
C:/elastic\_stack/logstash-7.8.1/logstash-core/lib/logstash/java\_pipeline.rb:374:in `inputworker' C:/elastic_stack/logstash-7.8.1/logstash-core/lib/logstash/java_pipeline.rb:365:in `block in start\_input'

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [August 19, 2020, 5:59pm UTC](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488/20 "2020-08-19T17:59:12Z")

</div>

> [@sukumar.koganti](#):
>
> Error: bad URI(is not URI?): Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=true;Initial Catalog=Dell  
> Exception: URI::InvalidURIError

The error is telling you that it is not correct. Are you using SQL Server? Do you have SQL Server Management Studio installed?

Guessing it could be the below. But you will need to get that from your side.

`jdbc_connection_string => "jdbc:sqlserver://XXXXX;databaseName=XXX;integratedSecurity=false;"`

[Next page](https://discuss.elastic.co/t/sql-server-data-to-elasticsearch-using-logstash/245488.md?page=2)
