# Jdbc update and delete

**URL:** https://discuss.elastic.co/t/jdbc-update-and-delete/74595
**Category:** Logstash
**Created:** [February 10, 2017, 4:36am UTC](https://discuss.elastic.co/t/jdbc-update-and-delete/74595 "2017-02-10T04:36:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Greentea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/greentea/32/15924_2.png) [@Greentea](https://discuss.elastic.co/u/Greentea)
#### Post date: [February 10, 2017, 4:36am UTC](https://discuss.elastic.co/t/jdbc-update-and-delete/74595/1 "2017-02-10T04:36:21Z")

</div>

Hi  
I am currently using logstash-plugin-jdbc to pull data from mysql to elasticsearch. I want to know is it possible to update or delete a single document in elasticsearch by modifying mysql?

For example, I got 1000 row in mysql table, and I modify no.349 row, I just want to update no.349 in elasticsearch, which is not passing the 1000 row again.

---

<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 12, 2017, 6:24pm UTC](https://discuss.elastic.co/t/jdbc-update-and-delete/74595/2 "2017-02-12T18:24:58Z")

</div>

Detecting row deletions is hard, but updated rows can be picked up if you have a "last modified" column that you can include in your query so that only rows modified since the last run are updated.

---

<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 12, 2017, 6:25pm UTC](https://discuss.elastic.co/t/jdbc-update-and-delete/74595/3 "2017-03-12T18:25:25Z")

</div>

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