# JDBC Plugin - sql\_last\_value equals a not existing timestamp

**URL:** <https://discuss.elastic.co/t/jdbc-plugin-sql-last-value-equals-a-not-existing-timestamp/96605>\
**Category:** Logstash\
**Created:** [August 10, 2017, 12:04pm UTC](https://discuss.elastic.co/t/jdbc-plugin-sql-last-value-equals-a-not-existing-timestamp/96605 "2017-08-10T12:04:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mberger1](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@mberger1](https://discuss.elastic.co/u/mberger1)\
**Post date:** [August 10, 2017, 12:04pm UTC](https://discuss.elastic.co/t/jdbc-plugin-sql-last-value-equals-a-not-existing-timestamp/96605/1 "2017-08-10T12:04:03Z")

</div>

Hey there,

I recently began to use the JDBC Plugin, which will be used to copy data (log data to be specific) from a table within an oracle database. Data is written there every few minutes later on and I just want to update the elasticsearch instance with every new row. While this seems to be working fine, I got 1 issue, which should be easily solveable, although I dont know how, yet.

The value for sql\_last\_value equals the timestamp, when the query was executed. But I would like it to be the latest date in my table.  
For example, this a query, extracted from the log file:  
SELECT \* from Log WHERE LOG\_TIME \> TIMESTAMP '2017-08-10 11:38:00.253000 +00:00'

But the newest data row is placed around march this year. With every minute, the query is executed again, and the value from sql\_last\_value is adding one minute.

This is my configuration:  
jdbc {  
jdbc\_connection\_string =\> "jdbc:oracle:thin://@DB:PORT:SID"  
jdbc\_user =\> "USER"  
jdbc\_password =\> "PASSWORD"  
jdbc\_driver\_library =\> "/home/logadmin/Downloads/ojdbc.jar"  
jdbc\_driver\_class =\> "Java::oracle.jdbc.driver.OracleDriver"  
tracking\_column =\> "LOG\_TIME"  
tracking\_column\_type =\> "timestamp"  
statement =\> "SELECT \* from ISI\_Log WHERE LOG\_TIME \> :sql\_last\_value"  
type =\> "db"   
schedule =\> "\*/1 \* \* \* \*"  
}

Is this even possible to archieve?

---

<div class="post-metadata">

**Author:** ![Harvii\_Dent](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@Harvii\_Dent](https://discuss.elastic.co/u/Harvii_Dent)\
**Post date:** [August 14, 2017, 12:35pm UTC](https://discuss.elastic.co/t/jdbc-plugin-sql-last-value-equals-a-not-existing-timestamp/96605/2 "2017-08-14T12:35:28Z")

</div>

I think you need to add `use_column_value => true`

---

<div class="post-metadata">

**Author:** ![mberger1](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@mberger1](https://discuss.elastic.co/u/mberger1)\
**Post date:** [August 31, 2017, 1:10pm UTC](https://discuss.elastic.co/t/jdbc-plugin-sql-last-value-equals-a-not-existing-timestamp/96605/3 "2017-08-31T13:10:28Z")

</div>

When doing that, I get the following message after every query:  
[2017-08-31T15:07:00,308][INFO][logstash.inputs.jdbc] (0.000000s) SELECT \* from ISI\_Log WHERE LOG\_TIME \>= TIMESTAMP '1970-01-01 01:00:00.000000 +01:00'  
[2017-08-31T15:07:00,308][WARN][logstash.inputs.jdbc] tracking\_column not found in dataset. {:tracking\_column=\>"LOG\_TIME"}

The time never changes and is always from the year 1970.

---

<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:** [September 28, 2017, 1:10pm UTC](https://discuss.elastic.co/t/jdbc-plugin-sql-last-value-equals-a-not-existing-timestamp/96605/4 "2017-09-28T13:10:43Z")

</div>

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