# Logstash jdbc plugin sql\_last\_value

**URL:** https://discuss.elastic.co/t/logstash-jdbc-plugin-sql-last-value/169704
**Category:** Logstash
**Created:** [February 24, 2019, 6:09am UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-sql-last-value/169704 "2019-02-24T06:09:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sahere37](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sahere37](https://discuss.elastic.co/u/sahere37)
#### Post date: [February 24, 2019, 6:09am UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-sql-last-value/169704/1 "2019-02-24T06:09:59Z")

</div>

hi all,  
I am using logstash jdbc plugin as following:

```
input {
 jdbc {
    jdbc_driver_library => "F:\driver\sqljdbc_6.0\enu\jre8\sqljdbc42.jar"
    jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
    jdbc_connection_string => "jdbc:sqlserver://localhost:3333;databaseName=TotalTXN"
    jdbc_user => "sss"
    jdbc_password => "sss"
    schedule => "* */1 * * *"
	clean_run => "true"
    statement => "SELECT date FROM dbo.TotalTxn_Control"
	use_column_value => "true"
	tracking_column => "date"
     }
}
output {
  elasticsearch { 
    hosts => ["http://192.168.170.153:9200"]
    index => "mssql3-%{+yyyy.MM.dd}"
    user => "logstash_internal25"
    password => "x-pack-test-password"
 }
  stdout { codec => rubydebug }
}

```

there are two issues:  
1-  
when logstash starts, in the kibana i can see date values but in different format, the format of date in database is for example as "02/24/2019" but in kibana is as "February 24th 2019" , how can i handle this issue? I want kibana shows "02/24/2019"  
2-  
based on my research, sql\_last\_value parameter can be used as a checkpoint to figure out about the last query. according above configuration, I want to last value of date (for example 02/24/2019) be saved in .logstash\_jdbc\_last\_run, but just "--- 0" can be seen in it. how can i handle this issue?

---

<div class="post-metadata">

### Author: ![sahere37](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sahere37](https://discuss.elastic.co/u/sahere37)
#### Post date: [February 24, 2019, 3:57pm UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-sql-last-value/169704/2 "2019-02-24T15:57:53Z")

</div>

it is solved.  
I just delete the "clean\_run" parameter

---

<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: [March 24, 2019, 4:09pm UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-sql-last-value/169704/3 "2019-03-24T16:09:26Z")

</div>

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