# Is where condition supported with logstash-jdbc input plugin

**URL:** <https://discuss.elastic.co/t/is-where-condition-supported-with-logstash-jdbc-input-plugin/27170>\
**Category:** Logstash\
**Created:** [August 11, 2015, 4:52am UTC](https://discuss.elastic.co/t/is-where-condition-supported-with-logstash-jdbc-input-plugin/27170 "2015-08-11T04:52:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)\
**Post date:** [August 11, 2015, 4:52am UTC](https://discuss.elastic.co/t/is-where-condition-supported-with-logstash-jdbc-input-plugin/27170/1 "2015-08-11T04:52:24Z")

</div>

Hi All

I am not able to create index if i provide a complex sql query like with where condition and join condition

But if i am providing simple "select \* from table', it is working well

Please let me know if complex queries is supported by jdbc input plugin or not.

More Info  
My source is mysql DB  
I am using mysql driver and simple query is working well

Regards  
Ritesh

---

<div class="post-metadata">

**Author:** ![talevy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/talevy/32/44896_2.png) [@talevy](https://discuss.elastic.co/u/talevy)\
**Post date:** [August 11, 2015, 6:07pm UTC](https://discuss.elastic.co/t/is-where-condition-supported-with-logstash-jdbc-input-plugin/27170/2 "2015-08-11T18:07:33Z")

</div>

The complexity of the query should not affect the behavior of the plugin. It is quite possible that the complex query is taking a long time, or some memory requirements are necessary and you are running into an out of memory exception. or, maybe that no results were returned from the specific query.

mind sharing the nature of your config and type of complex query you are running (exact private query is not necessary)

thanks!

---

<div class="post-metadata">

**Author:** ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)\
**Post date:** [August 12, 2015, 8:34am UTC](https://discuss.elastic.co/t/is-where-condition-supported-with-logstash-jdbc-input-plugin/27170/3 "2015-08-12T08:34:38Z")

</div>

Hi

Thanks for your reply.  
The query doesn't work they way we use in sql . In sql we apply table alias and do join query

Here in logstash i applied explicitly table\_name.column\_name for all the fields. Then the query is working fine.

---

<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 6, 2017, 4:51am UTC](https://discuss.elastic.co/t/is-where-condition-supported-with-logstash-jdbc-input-plugin/27170/5 "2017-07-06T04:51:30Z")

</div>


