# Data not showing when linking Mysql with ElasticSearch using logstash

**URL:** <https://discuss.elastic.co/t/data-not-showing-when-linking-mysql-with-elasticsearch-using-logstash/98524>\
**Category:** Logstash\
**Created:** [August 28, 2017, 9:12am UTC](https://discuss.elastic.co/t/data-not-showing-when-linking-mysql-with-elasticsearch-using-logstash/98524 "2017-08-28T09:12:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaibhav2903](https://avatars.discourse-cdn.com/v4/letter/v/a9a28c/32.png) [@vaibhav2903](https://discuss.elastic.co/u/vaibhav2903)\
**Post date:** [August 28, 2017, 9:12am UTC](https://discuss.elastic.co/t/data-not-showing-when-linking-mysql-with-elasticsearch-using-logstash/98524/1 "2017-08-28T09:12:16Z")

</div>

Hi! I am trying to link mysql with ElasticSearch using logstash. The database is getting connected but the schemas and the data are not being shown.  
My .conf file:  
**input {**  
\*\* jdbc {\*\*  
\*\* jdbc\_connection\_string =\> "jdbc:mysql://mylocalhost/persondetails"\*\*  
\*\* jdbc\_user =\> "root"\*\*  
\*\* jdbc\_password =\> "mypassword"\*\*  
\*\* schedule =\> "\* \* \* \* _"_\*  
\*\* jdbc\_validate\_connection =\> true\*\*  
\*\* jdbc\_driver\_library =\> "/usr/local/Cellar/logstash/5.5.2/mysql-connector-java-3.1.14/mysql-connector-java-3.1.14-bin.jar"\*\*  
\*\* jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"\*\*  
\*\* statement =\> "SELECT \* FROM Document"\*\*  
\*\* }\*\*  
**}**  
**output {**  
\*\* elasticsearch {\*\*  
\*\* #protocol=\>http\*\*  
\*\* index =\>"persondetails"\*\*  
\*\* document\_type =\> "Document"\*\*  
\*\* document\_id =\> "%{idDocument}"\*\*  
\*\* hosts =\> ["[http://localhost:9200](http://localhost:9200)"]\*\*  
\*\* codec =\> json\_lines\*\*  
\*\* }\*\*  
**}**  
Any problem with the configuration file?  
The output is as follows:  
**Sending Logstash's logs to /usr/local/Cellar/logstash/5.5.2/libexec/logs which is now configured via log4j2.properties**  
**[2017-08-28T14:29:43,857][INFO][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=\>{:removed=\>[], :added=\>[[http://localhost:9200/](http://localhost:9200/)]}}**  
**[2017-08-28T14:29:43,873][INFO][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck\_url=\>[http://localhost:9200/](http://localhost:9200/), :path=\>"/"}**  
**[2017-08-28T14:29:44,075][WARN][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=\>"[http://localhost:9200/](http://localhost:9200/)"}**  
**[2017-08-28T14:29:44,077][INFO][logstash.outputs.elasticsearch] Using mapping template from {:path=\>nil}**  
**[2017-08-28T14:29:44,184][INFO][logstash.outputs.elasticsearch] Attempting to install template {:manage\_template=\>{"template"=\>"logstash-_", "version"=\>50001, "settings"=\>{"index.refresh\_interval"=\>"5s"}, "mappings"=\>{"default"=\>{"\_all"=\>{"enabled"=\>true, "norms"=\>false}, "dynamic\_templates"=\>[{"message\_field"=\>{"path\_match"=\>"message", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false}}}, {"string\_fields"=\>{"match"=\>"_", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false, "fields"=\>{"keyword"=\>{"type"=\>"keyword", "ignore\_above"=\>256}}}}}], "properties"=\>{"@timestamp"=\>{"type"=\>"date", "include\_in\_all"=\>false}, "@version"=\>{"type"=\>"keyword", "include\_in\_all"=\>false}, "geoip"=\>{"dynamic"=\>true, "properties"=\>{"ip"=\>{"type"=\>"ip"}, "location"=\>{"type"=\>"geo\_point"}, "latitude"=\>{"type"=\>"half\_float"}, "longitude"=\>{"type"=\>"half\_float"}}}}}}}}**  
**[2017-08-28T14:29:44,195][INFO][logstash.outputs.elasticsearch] New Elasticsearch output {:class=\>"LogStash::Outputs::ElasticSearch", :hosts=\>["[http://localhost:9200](http://localhost:9200)"]}**  
**[2017-08-28T14:29:44,201][INFO][logstash.pipeline] Starting pipeline {"id"=\>"main", "pipeline.workers"=\>4, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>5, "pipeline.max\_inflight"=\>500}**  
**[2017-08-28T14:29:44,417][INFO][logstash.pipeline] Pipeline main started**  
**[2017-08-28T14:29:44,506][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}**  
**[2017-08-28T14:30:03,933][INFO][logstash.inputs.jdbc] (2.902000s) SELECT \* FROM Document**  
\*\* [2017-08-28T14:32:27,925][INFO][logstash.inputs.jdbc] (2.801000s) SELECT \* FROM Document\*\*  
**[2017-08-28T14:34:43,540][INFO][logstash.inputs.jdbc] (2.166000s) SELECT \* FROM Document**  
**[2017-08-28T14:36:58,760][INFO][logstash.inputs.jdbc] (2.377000s) SELECT \* FROM Document**

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 29, 2017, 5:28am UTC](https://discuss.elastic.co/t/data-not-showing-when-linking-mysql-with-elasticsearch-using-logstash/98524/2 "2017-08-29T05:28:36Z")

</div>

> ```
> codec => json_lines
> 
> ```

Remove this.

Is the jdbc input producing anything? Use a `stdout { codec => rubydebug }` to debug the situation.

---

<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:** [September 26, 2017, 5:28am UTC](https://discuss.elastic.co/t/data-not-showing-when-linking-mysql-with-elasticsearch-using-logstash/98524/3 "2017-09-26T05:28:45Z")

</div>

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