Delete elasticsearch document with logstash-jdbc-input

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 :slight_smile:

  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 elasticsearch, revise the data status, I think in elasticsearch revise is very difficult.

I want to listen your advise,

1 Like