# MYSQL DB to fetch data from table and push the same to elastic

**URL:** <https://discuss.elastic.co/t/mysql-db-to-fetch-data-from-table-and-push-the-same-to-elastic/109264>\
**Category:** Logstash\
**Created:** [November 27, 2017, 5:57pm UTC](https://discuss.elastic.co/t/mysql-db-to-fetch-data-from-table-and-push-the-same-to-elastic/109264 "2017-11-27T17:57:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![guruprasadh4](https://avatars.discourse-cdn.com/v4/letter/g/cab0a1/32.png) [@guruprasadh4](https://discuss.elastic.co/u/guruprasadh4)\
**Post date:** [November 27, 2017, 5:57pm UTC](https://discuss.elastic.co/t/mysql-db-to-fetch-data-from-table-and-push-the-same-to-elastic/109264/1 "2017-11-27T17:57:45Z")

</div>

Hello All,

I am trying to fetch the data from mysql db table and trying to push the same to elastic. Below is my config file and the error message that I am getting. Kindly review and let me know if there is something wrong with my config file.

Thanks in advance.

**Config file:**

input{  
jdbc{  
# mysql jdbc connection string to our backup databse  
jdbc\_connection\_string =\> "jdbc:mysql://10.10.10.1:3306/Guru"

```
            # the user we wish to excute our statement as
            jdbc_user => "guru"
            jdbc_password => "guru01"

            # the path to our downloaded jdbc driver
            jdbc_driver_library => "/home/gprasad9/Data/mysqldb/mysql-connector-java-5.1.44/mysql-connector-java-5.1.44-bin.jar "

            # the name of the driver class for mysql
            jdbc_driver_class => "com.mysql.jdbc.Driver"

            # the control statement
            #record_last_run=>true
            #type => "product"
            statement => "SELECT * FROM table_logstash"

```

}  
}

#filter{ }

output  
{  
elasticsearch {  
protocol =\> http  
index =\> "mysql-test"  
hosts =\> ["localhost:9200"]  
}  
stdout { codec =\> jasonlines }

**Error Message:**

[gprasad9@oc1008401175 logstash-5.6.2]$ tail -f -n90 nohup.out  
Sending Logstash's logs to /home/gprasad9/logstash-5.6.2/logs which is now configured via log4j2.properties  
[2017-11-28T00:57:44,576][INFO][logstash.modules.scaffold] Initializing module {:module\_name=\>"fb\_apache", :directory=\>"/home/gprasad9/logstash-5.6.2/modules/fb\_apache/configuration"}  
[2017-11-28T00:57:44,581][INFO][logstash.modules.scaffold] Initializing module {:module\_name=\>"netflow", :directory=\>"/home/gprasad9/logstash-5.6.2/modules/netflow/configuration"}  
[2017-11-28T00:57:44,880][ERROR][logstash.outputs.elasticsearch] Unknown setting 'protocol' for elasticsearch  
[2017-11-28T00:57:44,890][ERROR][logstash.agent] Cannot create pipeline {:reason=\>"Something is wrong with your configuration."}

---

<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:** [December 25, 2017, 7:29pm UTC](https://discuss.elastic.co/t/mysql-db-to-fetch-data-from-table-and-push-the-same-to-elastic/109264/3 "2017-12-25T19:29:54Z")

</div>

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