How to preserve :sql_last_value when running in Docker?

Hi all. I’m using the OS Logstash JDBC plugin. It allows SELECTs by a “:sql_last_value”. Per the docs:

The plugin will persist the sql_last_value parameter in the form of a metadata file stored in the configured last_run_metadata_path .

My problem is I’m running in Docker, so that file will be wiped out each time there’s a Docker update, and the plugin will read ALL the data again. Can anyone tell me how to configure Docker to store that file on the actual server disk, and read from it there?

Thanks!

:slight_smile:

@McJava1967 You could start the docker deployment and let the plugin create the file. Then copy it out of the container by using docker cp command.
The last step would be mounting the file as a volume. This way the file will be loaded every time you start docker or docker-compose. Also, changes will be reflected directly on that file.

Do you use docker-compose or just oneliner?

I am actually an idiot about Docker. :slight_smile: But I’ll run this by my helpful Docker person.

Thank you!