# Update / Delete rows in DB using Logstash JDBC input plugin

**URL:** <https://discuss.elastic.co/t/update-delete-rows-in-db-using-logstash-jdbc-input-plugin/186887>\
**Category:** Logstash\
**Created:** [June 21, 2019, 1:37pm UTC](https://discuss.elastic.co/t/update-delete-rows-in-db-using-logstash-jdbc-input-plugin/186887 "2019-06-21T13:37:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vasek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vasek/32/136636_2.png) [@vasek](https://discuss.elastic.co/u/vasek)\
**Post date:** [June 21, 2019, 1:37pm UTC](https://discuss.elastic.co/t/update-delete-rows-in-db-using-logstash-jdbc-input-plugin/186887/1 "2019-06-21T13:37:43Z")

</div>

Hi,  
is it possible to use SQL operations like **UPDATE** or **DELETE** in **[statement](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#plugins-inputs-jdbc-statement)** parameter of [Logstash JDBC input plugin](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html)? Or only **SELECT** operation is enabled?

Regads,  
Vasek

---

<div class="post-metadata">

**Author:** ![vasek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vasek/32/136636_2.png) [@vasek](https://discuss.elastic.co/u/vasek)\
**Post date:** [June 23, 2019, 7:44am UTC](https://discuss.elastic.co/t/update-delete-rows-in-db-using-logstash-jdbc-input-plugin/186887/2 "2019-06-23T07:44:40Z")

</div>

I found out that it is possible:

```
statement => "UPDATE logs SET marked_by_logstash = true WHERE marked_by_logstash = false"
statement => "DELETE FROM logs WHERE marked_by_logstash = true"
```

---

<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 21, 2019, 7:44am UTC](https://discuss.elastic.co/t/update-delete-rows-in-db-using-logstash-jdbc-input-plugin/186887/3 "2019-07-21T07:44:48Z")

</div>

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