# Update data from mysql to elasticsearch

**URL:** https://discuss.elastic.co/t/update-data-from-mysql-to-elasticsearch/106817
**Category:** Logstash
**Created:** [November 8, 2017, 8:19am UTC](https://discuss.elastic.co/t/update-data-from-mysql-to-elasticsearch/106817 "2017-11-08T08:19:30Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Shekhar\_Pandey](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Shekhar\_Pandey](https://discuss.elastic.co/u/Shekhar_Pandey)
#### Post date: [November 8, 2017, 8:19am UTC](https://discuss.elastic.co/t/update-data-from-mysql-to-elasticsearch/106817/1 "2017-11-08T08:19:30Z")

</div>

There is any way to fetch only update data from mysql to elasticsearch. I am using sql\_last\_value...but it will fetch only new row which comes in mysql....

Any way if I did change any previous index row in mysql...logstash fetch it and while indexing update its' version from 1 to 2.

Thank you.

---

<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: [November 8, 2017, 9:03am UTC](https://discuss.elastic.co/t/update-data-from-mysql-to-elasticsearch/106817/2 "2017-11-08T09:03:21Z")

</div>

If there's a "last modified" column in the table you can use that to determine which rows need to be updated in ES, but apart from fetching all rows all the time there's nothing much you can do.

---

<div class="post-metadata">

### Author: ![Shekhar\_Pandey](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Shekhar\_Pandey](https://discuss.elastic.co/u/Shekhar_Pandey)
#### Post date: [November 8, 2017, 9:11am UTC](https://discuss.elastic.co/t/update-data-from-mysql-to-elasticsearch/106817/3 "2017-11-08T09:11:34Z")

</div>

So Sir, there is no currently method to update bulk of rows ...who are already index ....

Thanks in advance

---

<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: [November 8, 2017, 10:16am UTC](https://discuss.elastic.co/t/update-data-from-mysql-to-elasticsearch/106817/4 "2017-11-08T10:16:28Z")

</div>

Logstash has no problem doing bulk updates but it needs help finding which rows from the database have changed since the last run.

---

<div class="post-metadata">

### Author: ![Shekhar\_Pandey](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Shekhar\_Pandey](https://discuss.elastic.co/u/Shekhar_Pandey)
#### Post date: [November 9, 2017, 6:51am UTC](https://discuss.elastic.co/t/update-data-from-mysql-to-elasticsearch/106817/5 "2017-11-09T06:51:54Z")

</div>

Ok Sir. 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: [December 7, 2017, 6:52am UTC](https://discuss.elastic.co/t/update-data-from-mysql-to-elasticsearch/106817/6 "2017-12-07T06:52:40Z")

</div>

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