# Logstash ConfigurationError, trying to migrate data from mysql to ELK using JDBC driver

**URL:** <https://discuss.elastic.co/t/logstash-configurationerror-trying-to-migrate-data-from-mysql-to-elk-using-jdbc-driver/186587>\
**Category:** Logstash\
**Created:** [June 20, 2019, 5:04am UTC](https://discuss.elastic.co/t/logstash-configurationerror-trying-to-migrate-data-from-mysql-to-elk-using-jdbc-driver/186587 "2019-06-20T05:04:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShashankAC](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@ShashankAC](https://discuss.elastic.co/u/ShashankAC)\
**Post date:** [June 20, 2019, 5:04am UTC](https://discuss.elastic.co/t/logstash-configurationerror-trying-to-migrate-data-from-mysql-to-elk-using-jdbc-driver/186587/1 "2019-06-20T05:04:38Z")

</div>

Hi there, I am new ELK and having some trouble configuring Logstash.

I tried to follow this tutorial

> **[Migrating MySql Data Into Elasticsearch Using Logstash](https://qbox.io/blog/migrating-mysql-data-into-elasticsearch-using-logstash)**
>
> In many cases we want to use inputs from different databases which are not natively supported by Elasticsearch. In this post we show how to migrate data from a MySql database to Elasticsearch via Logstash.

the config file is as follows.

input {  
jdbc {  
jdbc\_connection\_string =\> "jdbc:mysql://localhost/telecom1"  
# The user we wish to execute our statement as  
jdbc\_user =\> "xxxxx"  
jdbc\_password =\> "xxxxx"  
# The path to our downloaded jdbc driver  
jdbc\_driver\_library =\> "/usr/share/java/mysql-connector-java-8.0.16.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
# our query  
statement =\> "SELECT \* FROM state\_quality"  
}  
}

output {  
stdout { codec =\> json\_lines }  
elasticsearch {  
"hosts" =\> "localhost:9200"  
"index" =\> "state\_index"  
"document\_type" =\> "data"  
}  
}

after /usr/share/logstash# bin/logstash -f logstash.config

I am getting the below warnings and errors.

WARNING: Could not find logstash.yml which is typically located in $LS\_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults  
Sending Logstash logs to /usr/share/logstash/logs which is now configured via log4j2.properties  
[2019-06-20T10:21:34,028][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[2019-06-20T10:21:34,063][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"7.1.1"}  
[2019-06-20T10:21:42,618][ERROR][logstash.outputs.elasticsearch] Unknown setting '"document\_type"' for elasticsearch  
[2019-06-20T10:21:42,626][ERROR][logstash.outputs.elasticsearch] Unknown setting '"hosts"' for elasticsearch  
[2019-06-20T10:21:42,626][ERROR][logstash.outputs.elasticsearch] Unknown setting '"index"' for elasticsearch  
[2019-06-20T10:21:42,636][ERROR][logstash.agent] Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:main, :exception=\>"LogStash::ConfigurationError", :message=\>"Something is wrong with your configuration.", :backtrace=\>["/usr/share/logstash/logstash-core/lib/logstash/config/mixin.rb:86:in `config_init'", "/usr/share/logstash/logstash-core/lib/logstash/outputs/base.rb:60:in`initialize'", "org/logstash/config/ir/compiler/OutputStrategyExt.java:232:in `initialize'", "org/logstash/config/ir/compiler/OutputDelegatorExt.java:48:in`initialize'", "org/logstash/config/ir/compiler/OutputDelegatorExt.java:30:in `initialize'", "org/logstash/plugins/PluginFactoryExt.java:239:in`plugin'", "org/logstash/plugins/PluginFactoryExt.java:137:in `buildOutput'", "org/logstash/execution/JavaBasePipelineExt.java:50:in`initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java\_pipeline.rb:23:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:36:in`execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:325:in `block in converge\_state'"]}  
[2019-06-20T10:21:43,083][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
[2019-06-20T10:21:48,014][INFO][logstash.runner] Logstash shut down.

EDIT:  
I removed double quotes around "index" and "hosts" and removed the document\_type , and tried to run the config file. I got no errors,in the end I got

[2019-06-20T10:21:48,014][INFO][logstash.runner] Logstash shut down.

I checked logstash status and it was still active, so what does shut down logstash mean when it is still active ? and why is it shutting down ?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 20, 2019, 11:17am UTC](https://discuss.elastic.co/t/logstash-configurationerror-trying-to-migrate-data-from-mysql-to-elk-using-jdbc-driver/186587/2 "2019-06-20T11:17:03Z")

</div>

> [@ShashankAC](#):
>
> elasticsearch {  
> "hosts" =\> "localhost:9200"  
> "index" =\> "state\_index"  
> "document\_type" =\> "data"  
> }

On the left hand side it should be hosts rather than "hosts", index instead of "index" etc.

---

<div class="post-metadata">

**Author:** ![ShashankAC](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@ShashankAC](https://discuss.elastic.co/u/ShashankAC)\
**Post date:** [June 20, 2019, 12:30pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-trying-to-migrate-data-from-mysql-to-elk-using-jdbc-driver/186587/3 "2019-06-20T12:30:08Z")

</div>

Thanks !

Actually I made that edit and removed the depricated document\_type as mentioned in the EDIT: part of my post. Is it normal that logstash shuts down after the config file is run ?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 20, 2019, 1:33pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-trying-to-migrate-data-from-mysql-to-elk-using-jdbc-driver/186587/4 "2019-06-20T13:33:23Z")

</div>

> [@ShashankAC](#):
>
> Is it normal that logstash shuts down after the config file is run ?

No. There are a few cases (e.g. when using a stdin input and it reads EOF) where logstash will shut down, but usually it runs forever.

---

<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:** [July 18, 2019, 1:33pm UTC](https://discuss.elastic.co/t/logstash-configurationerror-trying-to-migrate-data-from-mysql-to-elk-using-jdbc-driver/186587/5 "2019-07-18T13:33:26Z")

</div>

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