# Mysql server to elasticsearch

**URL:** https://discuss.elastic.co/t/mysql-server-to-elasticsearch/167037
**Category:** Elasticsearch
**Created:** [February 4, 2019, 10:26pm UTC](https://discuss.elastic.co/t/mysql-server-to-elasticsearch/167037 "2019-02-04T22:26:50Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sahil\_ahmed](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sahil\_ahmed](https://discuss.elastic.co/u/sahil_ahmed)
#### Post date: [February 4, 2019, 10:26pm UTC](https://discuss.elastic.co/t/mysql-server-to-elasticsearch/167037/1 "2019-02-04T22:26:51Z")

</div>

Hello,

I am trying to input the data my sql server to the elasticsearch. i am running ELK in one server and mysql is in the other server they both are in the same network.I installed the mysql JDBC connector to the Server where i am running ELK. I am not sure what changes do i have to do with the logstash.yml file and with the config file.

---

<div class="post-metadata">

### Author: ![balumurari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/balumurari1/32/39203_2.png) [@balumurari1](https://discuss.elastic.co/u/balumurari1)
#### Post date: [February 5, 2019, 6:30am UTC](https://discuss.elastic.co/t/mysql-server-to-elasticsearch/167037/2 "2019-02-05T06:30:57Z")

</div>

hope you are very new to elasticsearch. Using logstash you can load data from MySQL server to elasticsearch.  
Try to explore n logstash.  
We can load data based on query[[Data mismatch in elasticsearch when loading data from database using logstash](https://discuss.elastic.co/t/data-mismatch-in-elasticsearch-when-loading-data-from-database-using-logstash/161513/2)]

---

<div class="post-metadata">

### Author: ![sahil\_ahmed](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sahil\_ahmed](https://discuss.elastic.co/u/sahil_ahmed)
#### Post date: [February 5, 2019, 2:21pm UTC](https://discuss.elastic.co/t/mysql-server-to-elasticsearch/167037/3 "2019-02-05T14:21:13Z")

</div>

did you make any changes to logstash.yml file like did you change the logstash bind address? @balumurari1

---

<div class="post-metadata">

### Author: ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)
#### Post date: [February 5, 2019, 2:45pm UTC](https://discuss.elastic.co/t/mysql-server-to-elasticsearch/167037/4 "2019-02-05T14:45:27Z")

</div>

like balumurari said you seems fresh to this. same happen to me.  
key is to read few thing and test. but here is some pre example. i am reading oracle data and hence it should be pretty much same

[root@localhost logstash]# cat logstash.yml |grep -v '#'  
node.name: mytest  
path.data: /data/logstash  
pipeline.workers: 4  
pipeline.batch.size: 256  
config.reload.automatic: false  
config.debug: false  
http.host: "localhost"  
path.logs: /log/logstash  
xpack.management.enabled: false

[root@localhost conf.d]# cat p1-jobs.conf |grep -v '#'  
input {  
jdbc {  
jdbc\_validate\_connection =\> true  
jdbc\_connection\_string =\> "jdbc:oracle:thin:@ora01:1521/\<db\_name\>"  
jdbc\_user =\> "user"  
jdbc\_password =\> "user1"  
jdbc\_driver\_library =\> "/usr/lib/oracle/12.2/client64/lib/ojdbc8.jar"  
jdbc\_driver\_class =\> "Java::oracle.jdbc.driver.OracleDriver"  
statement =\> "select JOB, PROJECT from JOBS where STATUS='running' "  
last\_run\_metadata\_path =\> "/tmp/logstash-db1.lastrun"  
use\_column\_value=\>true  
tracking\_column=\>"job"  
clean\_run=\>true  
record\_last\_run =\> true  
schedule =\> "\*/2 \* \* \* \*"  
}  
}

filter {  
}

output {  
stdout { codec =\> rubydebug }  
}

now run this config file from command line every time when you want to test it

```
/usr/share/logstash/bin/logstash -f p1-jobs.conf
```

---

<div class="post-metadata">

### Author: ![sahil\_ahmed](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sahil\_ahmed](https://discuss.elastic.co/u/sahil_ahmed)
#### Post date: [February 5, 2019, 3:14pm UTC](https://discuss.elastic.co/t/mysql-server-to-elasticsearch/167037/5 "2019-02-05T15:14:53Z")

</div>

yeah i am new to this, thank you.

---

<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: [March 5, 2019, 3:15pm UTC](https://discuss.elastic.co/t/mysql-server-to-elasticsearch/167037/6 "2019-03-05T15:15:28Z")

</div>

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