# Logstash 2.2 :sql\_last\_value

**URL:** <https://discuss.elastic.co/t/logstash-2-2-sql-last-value/41942>\
**Category:** Logstash\
**Created:** [February 16, 2016, 9:27pm UTC](https://discuss.elastic.co/t/logstash-2-2-sql-last-value/41942 "2016-02-16T21:27:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alainc](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@alainc](https://discuss.elastic.co/u/alainc)\
**Post date:** [February 16, 2016, 9:27pm UTC](https://discuss.elastic.co/t/logstash-2-2-sql-last-value/41942/1 "2016-02-16T21:27:39Z")

</div>

hi my input jdbc filter is like that

# file: simple-out.conf

input {  
jdbc {  
jdbc\_driver\_library =\> "C:/elastic/logstash-2.2.1/bin/ojdbc14.jar"  
jdbc\_driver\_class =\> "Java::oracle.jdbc.driver.OracleDriver"  
jdbc\_connection\_string =\> "jdbc:oracle:thin:@[//192.168.XX.YY:1521/dbname](https://192.168.XX.YY:1521/dbname)"  
jdbc\_user =\> "user"  
jdbc\_password =\> "pass"  
# schedule =\> "\* \* \* \* \*"  
clean\_run =\> false  
record\_last\_run =\> true  
statement =\> "SELECT \* from contact WHERE contact\_id \> :sql\_last\_value"  
use\_column\_value =\> true  
tracking\_column =\> contact\_id  
}  
}  
output {  
elasticsearch {  
index =\> "adress1"  
document\_type =\> "adress"  
hosts =\> ["localhost:9200"]  
}  
}

when i run it without tracking options and not the :sql\_last\_value it rune ok but import all each time  
want to import only new contact where the contact\_id (number not date) is greater than the previous greater

the things is that what is transmitted to database is always a time stamp not a value (should be 0 first time and after the previuos max )  
and i always got a ora-0932 saying that he expect a number not a timestamp  
how to say it's a 0 not a date?

thanks

---

<div class="post-metadata">

**Author:** ![alainc](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@alainc](https://discuss.elastic.co/u/alainc)\
**Post date:** [February 16, 2016, 10:35pm UTC](https://discuss.elastic.co/t/logstash-2-2-sql-last-value/41942/2 "2016-02-16T22:35:43Z")

</div>

found it myself

i had done a previous run with the use\_colum\_value to false so date was stored in last value  
i had to do a clean run so timestamp value was deleted and so value was init to 0 and no more import errors

hope it will help others

---

<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, 5:11am UTC](https://discuss.elastic.co/t/logstash-2-2-sql-last-value/41942/3 "2017-07-06T05:11:06Z")

</div>


