# Logstash-input-jdbc append where clause?

**URL:** https://discuss.elastic.co/t/logstash-input-jdbc-append-where-clause/135442
**Category:** Logstash
**Created:** [June 12, 2018, 12:08am UTC](https://discuss.elastic.co/t/logstash-input-jdbc-append-where-clause/135442 "2018-06-12T00:08:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dmongit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dmongit/32/31968_2.png) [@dmongit](https://discuss.elastic.co/u/dmongit)
#### Post date: [June 12, 2018, 12:08am UTC](https://discuss.elastic.co/t/logstash-input-jdbc-append-where-clause/135442/1 "2018-06-12T00:08:58Z")

</div>

I want to reuse some query files. I'm using jdbc statement\_filepath for a logstash input that is NOT on a schedule. I have another jdbc input with statement\_filepath with a very similar query that IS on a schedule. In fact, the queries are the same, except the scheduled input has a where clause on it.

Is there a way to append a where clause to my statement\_filepath? Since the first, not scheduled, query retrieves all data, I didn't want to use a post query filter (unless I had to).

The only thing that comes to mind is creating a new file from a base file and add that new query file to my docker container. That could work, but seems dirty if the ELK world already has it resolved.

I'm using mysql-connector-java-5.1.46 for my driver library if that matters.

Thanks!

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [June 12, 2018, 6:07am UTC](https://discuss.elastic.co/t/logstash-input-jdbc-append-where-clause/135442/2 "2018-06-12T06:07:02Z")

</div>

> Is there a way to append a where clause to my statement\_filepath?

No, not from within Logstash.

---

<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 10, 2018, 6:11am UTC](https://discuss.elastic.co/t/logstash-input-jdbc-append-where-clause/135442/3 "2018-07-10T06:11:02Z")

</div>

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