# Consume from dB then update/delete?

**URL:** <https://discuss.elastic.co/t/consume-from-db-then-update-delete/77197>\
**Category:** Logstash\
**Created:** [March 2, 2017, 5:47pm UTC](https://discuss.elastic.co/t/consume-from-db-then-update-delete/77197 "2017-03-02T17:47:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsps](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsps/32/5411_2.png) [@jsps](https://discuss.elastic.co/u/jsps)\
**Post date:** [March 2, 2017, 5:47pm UTC](https://discuss.elastic.co/t/consume-from-db-then-update-delete/77197/1 "2017-03-02T17:47:13Z")

</div>

Hello,

we have logs being written to a database - I can consume these using the jdbc plugin, but wanted to update the corresponding DB table with some flag like "consumed" or even delete the rows that are consumed .  
Does anyone do this already and could suggest how I could go about this or some other strategy perhaps?

thanks

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 3, 2017, 4:57am UTC](https://discuss.elastic.co/t/consume-from-db-then-update-delete/77197/2 "2017-03-03T04:57:02Z")

</div>

There's no way to do this natively in LS.

Maybe you can setup a stored proc that LS can call that reads and does this?

---

<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 31, 2017, 4:57am UTC](https://discuss.elastic.co/t/consume-from-db-then-update-delete/77197/3 "2017-03-31T04:57:23Z")

</div>

Closed on March 31, 2017, 4:57am UTC

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