# Logstash 7.1.1 not writing last\_run in last\_run\_metadata\_path

**URL:** <https://discuss.elastic.co/t/logstash-7-1-1-not-writing-last-run-in-last-run-metadata-path/188496>\
**Category:** Logstash\
**Created:** [July 2, 2019, 11:46am UTC](https://discuss.elastic.co/t/logstash-7-1-1-not-writing-last-run-in-last-run-metadata-path/188496 "2019-07-02T11:46:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giovanni\_Gasparri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/giovanni_gasparri/32/47880_2.png) [@Giovanni\_Gasparri](https://discuss.elastic.co/u/Giovanni_Gasparri)\
**Post date:** [July 2, 2019, 11:46am UTC](https://discuss.elastic.co/t/logstash-7-1-1-not-writing-last-run-in-last-run-metadata-path/188496/1 "2019-07-02T11:46:50Z")

</div>

Hello guys! I'm experiencing a problem with logstash 7.1.1 running as a deamon on debian with multiple pipelines.

Despite the fact that record\_last\_run is true and last\_run\_metadata\_path is specified, no file is saved.  
The file is not even found in the home folder of root/logstash user.

I tried to change location and extend permissions but with no luck.  
I was searching for this file because I would like to delete this file in order to force logstash to reload an index from scratch. I couldn't find it and therefore I deleted the index on elasticsearch. After a while I found that the entire index was populated again.  
I wonder... If logstash is not tracking the last run, does this means that every minute it's going to load all the docs into ElasticSearch?

Any suggestion is welcome. Thank you in advance

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 2, 2019, 1:02pm UTC](https://discuss.elastic.co/t/logstash-7-1-1-not-writing-last-run-in-last-run-metadata-path/188496/2 "2019-07-02T13:02:11Z")

</div>

It sounds like you are using a jdbc input. Can you show us the input configuration? (With sensitive data like passwords redacted.)

---

<div class="post-metadata">

**Author:** ![Giovanni\_Gasparri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/giovanni_gasparri/32/47880_2.png) [@Giovanni\_Gasparri](https://discuss.elastic.co/u/Giovanni_Gasparri)\
**Post date:** [July 2, 2019, 3:23pm UTC](https://discuss.elastic.co/t/logstash-7-1-1-not-writing-last-run-in-last-run-metadata-path/188496/3 "2019-07-02T15:23:08Z")

</div>

**Ciao Badger, here a simplified version of the input block.**

```
     input {
         jdbc {
             jdbc_driver_library => "/usr/share/java/mysql-connector-java-8.0.16.jar"
             jdbc_driver_class => "com.mysql.jdbc.Driver"
             jdbc_connection_string => "jdbc:mysql://servername:3306/databasename?useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=true&serverTimezone=UTC&zeroDateTimeBehavior=convertToNull"
             jdbc_user => "username"
             jdbc_password => "password"
             jdbc_paging_enabled => true
             schedule => "*/1 * * * *"
             statement => "SELECT field1,field2,UNIX_TIMESTAMP(timestamp_update) 
    as tracking_field FROM table where timestamp_update < now() and UNIX_TIMESTAMP(timestamp_update)>:sql_last_value 
    order by timestamp_update asc"
                     use_column_value => true
                     tracking_column => tracking_field
                     tracking_column_type => "numeric"
                     record_last_run => true
                     last_run_metadata_path => "/storage/elk/logstash/run_ordsummary"
                }
            }
```

---

<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 30, 2019, 3:33pm UTC](https://discuss.elastic.co/t/logstash-7-1-1-not-writing-last-run-in-last-run-metadata-path/188496/4 "2019-07-30T15:33:55Z")

</div>

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