# Logstash jdbc input for multiple queries

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-input-for-multiple-queries/171804>\
**Category:** Logstash\
**Created:** [March 11, 2019, 4:04pm UTC](https://discuss.elastic.co/t/logstash-jdbc-input-for-multiple-queries/171804 "2019-03-11T16:04:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rorixrebel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rorixrebel/32/41778_2.png) [@rorixrebel](https://discuss.elastic.co/u/rorixrebel)\
**Post date:** [March 11, 2019, 4:04pm UTC](https://discuss.elastic.co/t/logstash-jdbc-input-for-multiple-queries/171804/1 "2019-03-11T16:04:24Z")

</div>

Got 5+ queries that i need to run every X minutes so instead of creating multiple inputs i was thinking of using statement\_filepath to read all of them but seems like it doesn't quite accept wildcards (/my/queries/path/\*.sql) . Is there any workaround?

---

<div class="post-metadata">

**Author:** ![AquaX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aquax/32/92006_2.png) [@AquaX](https://discuss.elastic.co/u/AquaX)\
**Post date:** [March 11, 2019, 7:26pm UTC](https://discuss.elastic.co/t/logstash-jdbc-input-for-multiple-queries/171804/2 "2019-03-11T19:26:03Z")

</div>

Not that I am aware of.  
Multiple input pipelines might be your best option OR rewriting your SQL query so that you get all of the data back in a single statement.

---

<div class="post-metadata">

**Author:** ![rorixrebel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rorixrebel/32/41778_2.png) [@rorixrebel](https://discuss.elastic.co/u/rorixrebel)\
**Post date:** [March 11, 2019, 7:27pm UTC](https://discuss.elastic.co/t/logstash-jdbc-input-for-multiple-queries/171804/3 "2019-03-11T19:27:28Z")

</div>

yeah thats what we were thinking.... having all of the data we need into a single table and pull it from there.  
would be fantastic if the jdbc plugin would do multiple files.

anyway, thanks!!

---

<div class="post-metadata">

**Author:** ![AquaX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aquax/32/92006_2.png) [@AquaX](https://discuss.elastic.co/u/AquaX)\
**Post date:** [March 11, 2019, 7:28pm UTC](https://discuss.elastic.co/t/logstash-jdbc-input-for-multiple-queries/171804/4 "2019-03-11T19:28:50Z")

</div>

Could you create a view in your database and just query that?  
That way you are not relying on logstash for a long query, you can manipulate the view on the database backend.

---

<div class="post-metadata">

**Author:** ![rorixrebel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rorixrebel/32/41778_2.png) [@rorixrebel](https://discuss.elastic.co/u/rorixrebel)\
**Post date:** [March 13, 2019, 1:26pm UTC](https://discuss.elastic.co/t/logstash-jdbc-input-for-multiple-queries/171804/5 "2019-03-13T13:26:12Z")

</div>

I can't as im only pulling but ive already requested the DBA teams to either give me 1 huge query or create a view/table to host all of the data we need to pull.

thanks!

---

<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 10, 2019, 1:26pm UTC](https://discuss.elastic.co/t/logstash-jdbc-input-for-multiple-queries/171804/6 "2019-04-10T13:26:15Z")

</div>

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