# Changing logstash jdbc statement

**URL:** <https://discuss.elastic.co/t/changing-logstash-jdbc-statement/269037>\
**Category:** Logstash\
**Created:** [April 1, 2021, 2:02pm UTC](https://discuss.elastic.co/t/changing-logstash-jdbc-statement/269037 "2021-04-01T14:02:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gregorkosmina](https://avatars.discourse-cdn.com/v4/letter/g/3ab097/32.png) [@Gregorkosmina](https://discuss.elastic.co/u/Gregorkosmina)\
**Post date:** [April 1, 2021, 2:02pm UTC](https://discuss.elastic.co/t/changing-logstash-jdbc-statement/269037/1 "2021-04-01T14:02:54Z")

</div>

I want to change SQL statement in my logstash, so I would fill index with newely queried data.  
I re-run logstash with new statement but my index still contains old data. Am I missing something?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 1, 2021, 2:53pm UTC](https://discuss.elastic.co/t/changing-logstash-jdbc-statement/269037/2 "2021-04-01T14:53:13Z")

</div>

That is expected. If you want the index to just contain the data from the latest run you would have to delete the index before running logstash the second time.

---

<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:** [April 29, 2021, 2:53pm UTC](https://discuss.elastic.co/t/changing-logstash-jdbc-statement/269037/3 "2021-04-29T14:53:25Z")

</div>

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