# Logstash not updating last run metadata file

**URL:** https://discuss.elastic.co/t/logstash-not-updating-last-run-metadata-file/247730
**Category:** Logstash
**Created:** [September 7, 2020, 8:42am UTC](https://discuss.elastic.co/t/logstash-not-updating-last-run-metadata-file/247730 "2020-09-07T08:42:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![RiadhBH](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/riadhbh/32/74303_2.png) [@RiadhBH](https://discuss.elastic.co/u/RiadhBH)
#### Post date: [September 7, 2020, 8:42am UTC](https://discuss.elastic.co/t/logstash-not-updating-last-run-metadata-file/247730/1 "2020-09-07T08:42:55Z")

</div>

In my Logstash I want to download from a huge database table. To avoid overload, I tried to get data of each day separately (since 20 years) and copied it to elasticsearch. I used :sql\_last\_value as follow, but it does not update!!

> input {  
> jdbc\_driver\_library =\> "/opt/driver/mssql-jdbc.jar"  
> jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
> jdbc\_connection\_string =\> "jdbc:sqlserver://host:port;databaseName=ZENmydb"  
> jdbc\_user =\> "username"  
> jdbc\_password =\> "password"  
> jdbc\_default\_timezone =\> "UTC"  
> schedule =\> "\* \* \* \* \*"  
> statement =\> "SELECT filed1, filed2, filed3, filed4, DATEADD(day, 1,:sql\_last\_value) as lastupdate FROM table WHERE field3 between :sql\_last\_value AND DATEADD(day, 1,:sql\_last\_value)"  
> use\_column\_value =\> true  
> tracking\_column =\> lastupdate  
> tracking\_column\_type =\> "timestamp"  
> last\_run\_metadata\_path =\> "/opt/config/sql\_last\_value.yml"  
> }

The content of sql\_las\_value\_.yml --\> --- !ruby/object:DateTime '2000-01-01 00:00:00.000000000 Z'

I got always the values between '2000-01-01 00:00:00' and '2000-01-02 00:00:00'

---

<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: [October 5, 2020, 8:43am UTC](https://discuss.elastic.co/t/logstash-not-updating-last-run-metadata-file/247730/2 "2020-10-05T08:43:04Z")

</div>

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