# MySQL to Elasticsearch

**URL:** https://discuss.elastic.co/t/mysql-to-elasticsearch/41367
**Category:** Logstash
**Created:** [February 10, 2016, 11:00am UTC](https://discuss.elastic.co/t/mysql-to-elasticsearch/41367 "2016-02-10T11:00:01Z")
**Posts on this page:** 7
**Page:** 2

<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: [February 14, 2016, 10:34am UTC](https://discuss.elastic.co/t/mysql-to-elasticsearch/41367/21 "2016-02-14T10:34:05Z")

</div>

For now, disable the elasticsearch output and insert a `stdout { codec => rubydebug }` output. Look in the logs. Warning messages are emitted for various kinds of error conditions. If there's nothing interesting there, increase logging verbosity by starting Logstash with `--verbose` or `--debug`. Look in the logs again. You should e.g. see every query that's sent for execution.

---

<div class="post-metadata">

### Author: ![Croos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/croos/32/29489_2.png) [@Croos](https://discuss.elastic.co/u/Croos)
#### Post date: [February 15, 2016, 8:41am UTC](https://discuss.elastic.co/t/mysql-to-elasticsearch/41367/22 "2016-02-15T08:41:24Z")

</div>

Its now working successfully 🙂. My error is, the plug in was not completely updated. Thank you very much **Magnus**. See you on another thread.

Regards,  
Croos.

---

<div class="post-metadata">

### Author: ![Croos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/croos/32/29489_2.png) [@Croos](https://discuss.elastic.co/u/Croos)
#### Post date: [February 15, 2016, 10:17am UTC](https://discuss.elastic.co/t/mysql-to-elasticsearch/41367/23 "2016-02-15T10:17:11Z")

</div>

How to update the existing document by schedule, when a MySQL table row is updated?  
Example:

```
+---+------+---------+
|id | name | city |
+---+------+---------+
| 11| croos| chennai |
| 22| nilu | colombo |
+---+------+---------+

+---+------+---------+
|id | name | city |
+---+------+---------+
| 11| croos| trichy |
| 22| nilu | colombo |
+---+------+---------+

```

In this case how to update city on elasticsearch by schedule?

---

<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: [February 15, 2016, 12:31pm UTC](https://discuss.elastic.co/t/mysql-to-elasticsearch/41367/24 "2016-02-15T12:31:57Z")

</div>

I answered a very similar question in the past couple of days. Set elasticsearch's `document_id` option to the desired id of the document (perhaps the "id" column) instead of letting Elasticsearch allocate a random id. Then Logstash will be able to update the existing document. You may have to modify the `action` option too.

---

<div class="post-metadata">

### Author: ![Croos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/croos/32/29489_2.png) [@Croos](https://discuss.elastic.co/u/Croos)
#### Post date: [February 15, 2016, 12:52pm UTC](https://discuss.elastic.co/t/mysql-to-elasticsearch/41367/25 "2016-02-15T12:52:34Z")

</div>

Would you please give me some example links..

---

<div class="post-metadata">

### Author: ![Croos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/croos/32/29489_2.png) [@Croos](https://discuss.elastic.co/u/Croos)
#### Post date: [February 15, 2016, 1:29pm UTC](https://discuss.elastic.co/t/mysql-to-elasticsearch/41367/26 "2016-02-15T13:29:31Z")

</div>

I had an [example](https://discuss.elastic.co/t/logstash-jdbc-plugin-question/41586) from your previous answer. For now, this is enough to me. Thanks and catch you soon 😀 ..!

---

<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 6, 2017, 5:11am UTC](https://discuss.elastic.co/t/mysql-to-elasticsearch/41367/27 "2017-07-06T05:11:27Z")

</div>



[Previous page](https://discuss.elastic.co/t/mysql-to-elasticsearch/41367.md?page=1)
