# Logstash not updating last run metadata file

**URL:** https://discuss.elastic.co/t/logstash-not-updating-last-run-metadata-file/133876
**Category:** Logstash
**Created:** [May 30, 2018, 1:14pm UTC](https://discuss.elastic.co/t/logstash-not-updating-last-run-metadata-file/133876 "2018-05-30T13:14:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MichaelDz](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@MichaelDz](https://discuss.elastic.co/u/MichaelDz)
#### Post date: [May 30, 2018, 1:14pm UTC](https://discuss.elastic.co/t/logstash-not-updating-last-run-metadata-file/133876/1 "2018-05-30T13:14:13Z")

</div>

In my Logstash I want to download from a database the most recent data using `:sql_last_value` in a query and `tracking_column` option in conf file. I've set last\_run\_metadata\_path because I have 2 pipelines for the same table but Logstash saved last date only once or stopped saving new dates and now I can see in logs that it runs queries with the same :sql\_last\_value from metadata file.

That's how my conf file looks like, it has many jdbc inputs and one of them below:

```
  jdbc {
        jdbc_driver_library => "/opt/logstash/lib/ojdbc8.jar"
        jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
        jdbc_connection_string => ""
        jdbc_user => ""
        jdbc_password => ""
        schedule => "*/15 * * * *"
        statement_filepath => "/etc/logstash/queries/UAT/transactions_UAT.sql"
        use_column_value => true
        tracking_column => 'sys_created_on'
        tracking_column_type => "timestamp"
        last_run_metadata_path => "/etc/logstash/conf.d/lastrun_metadata/transactions_uat_metadata"
        tags => ["transactions_uat"]
  }

```

Content of the metadata file:

`--- 2018-05-26 08:41:55.000000000 -04:00`  
I can see in the logs that Logstash always uses the same date from the metadata file and newer updates it:

```
select * from snc_uat.syslog_transaction0007
 where "sys_created_on" >= TIMESTAMP '2018-05-26 08:41:55.000000 -04:00' 

```

Logstash is working and is downloading recent data but unnecessarily processes data that already exists. Why is Logstash not updating metadata?

---

<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: [June 27, 2018, 1:14pm UTC](https://discuss.elastic.co/t/logstash-not-updating-last-run-metadata-file/133876/2 "2018-06-27T13:14:14Z")

</div>

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