# Logstash in docker input jdbc plugin not updating last\_run\_metadata\_path

**URL:** <https://discuss.elastic.co/t/logstash-in-docker-input-jdbc-plugin-not-updating-last-run-metadata-path/37411>\
**Category:** Logstash\
**Created:** [December 16, 2015, 9:26pm UTC](https://discuss.elastic.co/t/logstash-in-docker-input-jdbc-plugin-not-updating-last-run-metadata-path/37411 "2015-12-16T21:26:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sripri](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@sripri](https://discuss.elastic.co/u/sripri)\
**Post date:** [December 16, 2015, 9:26pm UTC](https://discuss.elastic.co/t/logstash-in-docker-input-jdbc-plugin-not-updating-last-run-metadata-path/37411/1 "2015-12-16T21:26:33Z")

</div>

Hi I am trying to use the input jdbc plugin  
`jdbc { type => "logs" jdbc_driver_library => "/opt/logstash/driver/ojdbc6.jar" jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver" jdbc_connection_string => "jdbc:oracle:thin:@//<host>:<port>/<database>" jdbc_user => " ****" jdbc_password => "****" jdbc_fetch_size => 1000 schedule => "* * * * *" statement => "select CONNECTION_ID, IPADDRESS, START_DATE, ELAPSED_TIME_MS, GUI_EVENT_TYPE, GUI_EVENT_NAME, GUI_EVENT_PARAMS from xxxx where start_date>to_date(:sql_last_start, 'DD-MON-YY HH24:MI:SS')" clean_run => false record_last_run => true last_run_metadata_path => "/opt/logstash/lastrun/.logstash_jdbc_last_run" }`  
I have logstash running in a docker container. The metadata file is volume mapped as follows:

`-v - /opt/logstash/lastrun/.logstash_jdbc_last_run:/opt/logstash/lastrun/.logstash_jdbc_last_run`  
However, I am not seeing logstash update the meta file with last run date. Not sure where the problem is. Any help would be great.  
Thanks

---

<div class="post-metadata">

**Author:** ![liweigao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/liweigao/32/6736_2.png) [@liweigao](https://discuss.elastic.co/u/liweigao)\
**Post date:** [December 19, 2015, 9:49am UTC](https://discuss.elastic.co/t/logstash-in-docker-input-jdbc-plugin-not-updating-last-run-metadata-path/37411/2 "2015-12-19T09:49:16Z")

</div>

Hello, you're wrong, you need to know this.The plugin will persist the sql\_last\_start parameter in the form of a metadata file stored in the configured last\_run\_metadata\_path. Upon shutting down, this file will be updated with the current value of sql\_last\_start. Next time the pipeline starts up, this value will be updated by reading from the file. If clean\_run is set to true, this value will be ignored and sql\_last\_start will be set to Jan 1, 1970, as if no query has ever been executed.

These are the official website of the document, I also want to update the configuration time, but I do not know, it is not possible to achieve

---

<div class="post-metadata">

**Author:** ![sripri](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@sripri](https://discuss.elastic.co/u/sripri)\
**Post date:** [December 20, 2015, 2:59am UTC](https://discuss.elastic.co/t/logstash-in-docker-input-jdbc-plugin-not-updating-last-run-metadata-path/37411/3 "2015-12-20T02:59:58Z")

</div>

I don't see any value add in your answer by repeating the obvious. Yes, I checked the website documentation and understand what should happen. The question relates to why it is not. The problem was really with my docker volume mapping. I set it to -v - /opt/logstash/lastrun:/opt/logstash/lastrun. Docker processes files and directories differently.

---

<div class="post-metadata">

**Author:** ![Djelouah\_Laala](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@Djelouah\_Laala](https://discuss.elastic.co/u/Djelouah_Laala)\
**Post date:** [July 5, 2017, 9:29am UTC](https://discuss.elastic.co/t/logstash-in-docker-input-jdbc-plugin-not-updating-last-run-metadata-path/37411/4 "2017-07-05T09:29:32Z")

</div>

Hi Sripri,

I'm encountring the same problem (getting an error like this :  
`No such file or directory - /var/www/.logstash_jdbc_last_run`  
Did you finally find an issue to this problem?

---

<div class="post-metadata">

**Author:** ![Johan\_Thomas](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@Johan\_Thomas](https://discuss.elastic.co/u/Johan_Thomas)\
**Post date:** [December 8, 2017, 12:15pm UTC](https://discuss.elastic.co/t/logstash-in-docker-input-jdbc-plugin-not-updating-last-run-metadata-path/37411/5 "2017-12-08T12:15:42Z")

</div>

Hi @Djelouah_Laala @sripri  
I'm having the same issue. Dont know how to have my dockerised logstash work with JDBC input and last\_run\_metadata\_path...

Do you have any idea ?  
Thanks a lot

---

<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:** [November 4, 2022, 4:11am UTC](https://discuss.elastic.co/t/logstash-in-docker-input-jdbc-plugin-not-updating-last-run-metadata-path/37411/6 "2022-11-04T04:11:27Z")

</div>


