# Error connecting MySQL with Logstash

**URL:** <https://discuss.elastic.co/t/error-connecting-mysql-with-logstash/184637>\
**Category:** Logstash\
**Created:** [June 6, 2019, 5:19pm UTC](https://discuss.elastic.co/t/error-connecting-mysql-with-logstash/184637 "2019-06-06T17:19:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohn07](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rohn07](https://discuss.elastic.co/u/Rohn07)\
**Post date:** [June 6, 2019, 5:19pm UTC](https://discuss.elastic.co/t/error-connecting-mysql-with-logstash/184637/1 "2019-06-06T17:19:27Z")

</div>

**mysql.conf**  
input{  
jdbc {  
jdbc\_driver\_library =\> "C:\ELK\mysql-connector-java-5.1.36-bin.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://localhost:3306/test"  
jdbc\_user =\> "root"  
jdbc\_password =\> "Password"  
schedule =\> "5 \* \* \* \* \*"  
statement =\> "SELECT \* from cars"  
use\_column\_value =\> "true"  
tracking\_column-type =\> "timestramp"  
}  
}

output{

```
elasticsearch{

	index => "id"
	document type => "cars"
	document id => "%(ID)"
	hosts => "localhost:9200"
}

stdout{
	codec => rubydebug
}

```

}

**Error**  
[2019-06-06T22:33:03,078][ERROR][logstash.agent] Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:main, :exception=\>"LogStash::ConfigurationError", :message=\>"Expected one of #, =\> at line 20, column 12 (byte 481) after output{\r\n\r\n\telasticsearch{\r\n\r\n\t\tindex =\> "id"\r\n\t\tdocument ", :backtrace=\>["C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/compiler.rb:41:in `compile_imperative'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/compiler.rb:49:in`compile\_graph'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/compiler.rb:11:in `block in compile_sources'", "org/jruby/RubyArray.java:2577:in`map'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/compiler.rb:10:in `compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:151:in`initialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in `initialize'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:23:in`initialize'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/pipeline\_action/create.rb:36:in `execute'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/agent.rb:325:in`block in converge\_state'"]}

Any help would be appreciated. Thank you in Advance.

---

<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 6, 2019, 5:30pm UTC](https://discuss.elastic.co/t/error-connecting-mysql-with-logstash/184637/2 "2019-06-06T17:30:07Z")

</div>

> [@Rohn07](#):
>
> document type =\> "cars" document id =\> "%(ID)"

You are missing underscores in the option names.

If you are just getting started you probably do not want to use document\_type, since document types are being [eliminated](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html).

---

<div class="post-metadata">

**Author:** ![Rohn07](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rohn07](https://discuss.elastic.co/u/Rohn07)\
**Post date:** [June 6, 2019, 5:45pm UTC](https://discuss.elastic.co/t/error-connecting-mysql-with-logstash/184637/3 "2019-06-06T17:45:11Z")

</div>

Yes, I am new to this technology and learning it, along with its implementation.

I tried running the code, with the errors which you told. But then after I am facing again a new error.

**New Error Message**

[2019-06-06T23:09:56,278][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=\>["C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/config/mixin.rb:86:in `config_init'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/inputs/base.rb:60:in`initialize'", "org/logstash/plugins/PluginFactoryExt.java:255:in `plugin'", "org/logstash/plugins/PluginFactoryExt.java:117:in`buildInput'", "org/logstash/execution/JavaBasePipelineExt.java:50:in `initialize'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:23:in`initialize'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/pipeline\_action/create.rb:36:in `execute'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/agent.rb:325:in`block in converge\_state'"]}

---

<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 6, 2019, 6:04pm UTC](https://discuss.elastic.co/t/error-connecting-mysql-with-logstash/184637/4 "2019-06-06T18:04:43Z")

</div>

There should be another message preceding that one.

---

<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 4, 2019, 6:12pm UTC](https://discuss.elastic.co/t/error-connecting-mysql-with-logstash/184637/5 "2019-07-04T18:12:27Z")

</div>

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