# Delete elasticsearch document with logstash-jdbc-input

**URL:** <https://discuss.elastic.co/t/delete-elasticsearch-document-with-logstash-jdbc-input/47490>\
**Category:** Logstash\
**Created:** [April 15, 2016, 9:20am UTC](https://discuss.elastic.co/t/delete-elasticsearch-document-with-logstash-jdbc-input/47490 "2016-04-15T09:20:45Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![laoyang360](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@laoyang360](https://discuss.elastic.co/u/laoyang360)\
**Post date:** [June 23, 2016, 1:52am UTC](https://discuss.elastic.co/t/delete-elasticsearch-document-with-logstash-jdbc-input/47490/9 "2016-06-23T01:52:57Z")

</div>

First, you know, In mysql we just use delete from \* to delete some date we don't use.  
Second, We want to sync the delete information, as you say, "add a "status" column", what you say is 🙂

1. in mysql, just add a status column to indetify the date is ok or not, just like:  
mysql\> select \* from cc;  
+----+--------------------+--------+  
| id | name | status |  
+----+--------------------+--------+  
| 1 | laoyang360 | ok |  
| 4 | intok | ok |  
| 5 | jdbc\_test\_update08 | ok |  
| 7 | test7 | ok |  
| 8 | test008 | ok |  
| 9 | test9 | ok |  
| 10 | test10 | ok |  
+----+--------------------+--------+  
7 rows in set (0.00 sec)

mysql\>  
mysql\>  
mysql\> update cc set status = 'deleted' where id = 10;  
Query OK, 1 row affected (0.02 sec)  
Rows matched: 1 Changed: 1 Warnings: 0

mysql\> select \* from cc;  
+----+--------------------+---------+  
| id | name | status |  
+----+--------------------+---------+  
| 1 | laoyang360 | ok |  
| 4 | intok | ok |  
| 5 | jdbc\_test\_update08 | ok |  
| 7 | test7 | ok |  
| 8 | test008 | ok |  
| 9 | test9 | ok |  
| 10 | test10 | deleted |  
+----+--------------------+---------+  
7 rows in set (0.00 sec)

[2.In](http://2.In) elasticsearch, revise the data status, I think in elasticsearch revise is very difficult.

I want to listen your advise,

---

_[View the full topic](https://discuss.elastic.co/t/delete-elasticsearch-document-with-logstash-jdbc-input/47490)._
