# No traking sql\_last\_value value in jdbc plugin

**URL:** <https://discuss.elastic.co/t/no-traking-sql-last-value-value-in-jdbc-plugin/48219>\
**Category:** Logstash\
**Created:** [April 23, 2016, 7:21am UTC](https://discuss.elastic.co/t/no-traking-sql-last-value-value-in-jdbc-plugin/48219 "2016-04-23T07:21:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jalen\_wang](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jalen\_wang](https://discuss.elastic.co/u/jalen_wang)\
**Post date:** [April 23, 2016, 7:21am UTC](https://discuss.elastic.co/t/no-traking-sql-last-value-value-in-jdbc-plugin/48219/1 "2016-04-23T07:21:05Z")

</div>

I'm going to use `jdbc` plugin to get data from oracle database,below is my sample data:

```auto
OP_TYPE OP_DATE OBJ_NAME LAG HOSTNAME GROUP_NAME RECORDLENGTH TIMESTAMP FILESEQNO FILERBA ID
---------- ------------ ---------- ---------- ---------- ---------- ------------ ------------ ---------- ---------- ----------
INSERT 23-4-16 SOURCE.T1 4 oracle02 REPTGT 22 23-4-16 ########## ########## 101
INSERT 23-4-16 SOURCE.T1 4 oracle02 REPTGT 23 23-4-16 ########## ########## 102

```

Column `ID` is an auto-increment column and this value will be saved to determine where to start.but if i set `use_column_value` to `true`,`sql_last_value` will be `0`, set `use_column_column_value` to `false`,`sql_last_value` will be saved as a timestamp.  
Anyone could help me to save my actual ID value to sql\_last\_value?  
below is my currently configuration

```auto
input {
    jdbc {
        jdbc_validate_connection => true
        jdbc_connection_string => "jdbc:oracle:thin:@114.94.154.172:1521/orcl"
        jdbc_user => "ogg"
        jdbc_password => "ogg"
        jdbc_driver_library => "/home/logstash/ojdbc7.jar"
        jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
        clean_run => false
        record_last_run => true
        statement => "select ID,OP_TYPE,OP_DATE,OBJ_NAME,LAG,HOSTNAME,GROUP_NAME,RECORDLENGTH,TIMESTAMP,FILESEQNO,FILERBA from ogg.ogg_history where ID>:sql_last_value"
        use_column_value => true
        tracking_column => ID
        last_run_metadata_path => "/tmp/logstash-oradb.lastrun"
        schedule => "* * * * *"
       }
}
#mutate { remove_field => ["force_matching_signature"] }
filter {
    # Set the timestamp to that of the ASH sample, not current time.
    mutate { convert => ["sample_time" , "string"]}
    date { match => ["sample_time", "ISO8601"]}
}
output {
    stdout { codec => rubydebug }
    elasticsearch {hosts=>"xx.xx.xx.xx"}
}

```

sql\_last\_value:

```auto
[logstash@iZ23qrdz9ieZ tmp]$ cat logstash-oradb.lastrun 
--- 0
[logstash@iZ23qrdz9ieZ tmp]$ cat logstash-oradb.lastrun 
--- 2016-04-23 07:08:00.012000000 Z

```

---

<div class="post-metadata">

**Author:** ![oculushut](https://avatars.discourse-cdn.com/v4/letter/o/dec6dc/32.png) [@oculushut](https://discuss.elastic.co/u/oculushut)\
**Post date:** [May 22, 2017, 9:19pm UTC](https://discuss.elastic.co/t/no-traking-sql-last-value-value-in-jdbc-plugin/48219/2 "2017-05-22T21:19:39Z")

</div>

Hi there - just out of interest, but was this issue resolved in the end? 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:** [July 6, 2017, 4:26am UTC](https://discuss.elastic.co/t/no-traking-sql-last-value-value-in-jdbc-plugin/48219/3 "2017-07-06T04:26:25Z")

</div>


