# How to set the where filter about sql\_last\_value?

**URL:** <https://discuss.elastic.co/t/how-to-set-the-where-filter-about-sql-last-value/53621>\
**Category:** Logstash\
**Created:** [June 22, 2016, 7:46am UTC](https://discuss.elastic.co/t/how-to-set-the-where-filter-about-sql-last-value/53621 "2016-06-22T07:46:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![laoyang360](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@laoyang360](https://discuss.elastic.co/u/laoyang360)\
**Post date:** [June 22, 2016, 7:46am UTC](https://discuss.elastic.co/t/how-to-set-the-where-filter-about-sql-last-value/53621/1 "2016-06-22T07:46:12Z")

</div>

I have been already installed Logstash JDBC Input Plugin successfully.  
And I set sql as follows:

```
select *
from 
	cc
where cc.last_modify_time >= :smile: sql_last_value

```

I already know the cc.last\_modify\_time setting is wrong, How can I correct it ?  
for another thing, how to set the where filter?

I searched google for long time, but I have no result.

Thank you very much?

---

<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:** [June 24, 2016, 4:42am UTC](https://discuss.elastic.co/t/how-to-set-the-where-filter-about-sql-last-value/53621/2 "2016-06-24T04:42:51Z")

</div>

There's an example here - [https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#\_predefined\_parameters](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#_predefined_parameters)

However you config has been mangled, used the `</>` button to properly format posts.

---

<div class="post-metadata">

**Author:** ![laoyang360](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@laoyang360](https://discuss.elastic.co/u/laoyang360)\
**Post date:** [June 24, 2016, 5:39am UTC](https://discuss.elastic.co/t/how-to-set-the-where-filter-about-sql-last-value/53621/3 "2016-06-24T05:39:17Z")

</div>

Tks, I already fixed the above bug by add the new column last\_modify\_time to my table cc, just like:

`mysql> alter table cc add column modified_at TIMESTAMP NOT NULL default CURRENT_TIMESTAMP;`

---

<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:50am UTC](https://discuss.elastic.co/t/how-to-set-the-where-filter-about-sql-last-value/53621/4 "2017-07-06T04:50:55Z")

</div>

Closed on July 6, 2017, 4:50am UTC


