Config.reload.automatic ignored on Logstash Docker container


Docker details

Docker Desktop (Community) for Mac Version (30215), engine 18.09.1


I'm using the repo to compose the Docker services.

Here's the logstash service section of my docker-compose.yml:

    context: logstash/
      # $ELK_VERSION is 6.3.2
    - ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml:ro
    - ./logstash/pipeline:/usr/share/logstash/pipeline:ro
    - ""
    - ""
    LS_JAVA_OPTS: "-Xmx2g -Xms2g"

    # Should (but doesn't in practice) reload logstash.conf every 3 seconds.
    LS_OPTS: "--config.reload.automatic"
    - elk
    - elasticsearch


## Default Logstash configuration from logstash-docker.
## from "" # The default
path.config: /usr/share/logstash/pipeline


In my logstash.conf, I have a ruby filter to mutate an object meeting certain conditions.

Test setup

Initially, I'd have logstash.conf configured to mutate an object's field to set its value to "value A"; and by changing (and saving) logstash.conf on my host machine I could alter it to set that instead to "value B".

Results of test

However, despite saving it with new changes, my stream of log messages continue to have their data field mutated to "value A", indicating that the change in configuration was not loaded in.

Positive control

As recommended in Reloading the Config File, Upon entering the Docker container (via docker exec -it <Container ID> sh) and sending a SIGHUP signal to the Logstash process (ps -ef to list processes; kill -1 <PID of the Logstash process> to kill it), I was able to force a reload of logstash.conf, and "value B" did appear as would have been expected.


So despite logstash.conf being volume-mounted into the Docker container correctly, I can see through my easily-diagnosable experiment (of changing the configuration for mapping log values) that config.reload.automatic is not taking any effect.

What is the correct way to invoke config.reload.automatic in Logstash for Docker?

Related issues

Both of these remain unanswered (partially due to lack of details).

Config.reload.automatic for logstash docker container

Changing logstash config in docker container

I can confirm, I am seeing the same thing.

I am running the container in kube. I pass in my variables (LS_OPTS and LS_JAVA_OPTS). I can see them in the environment

declare -x LS_JAVA_OPTS="-Xms1024m -Xmx1024m"
declare -x LS_OPTS="--config.reload.automatic --config.reload.interval 20"

But the options are not in the command line.

I am using the logstash 6.5.4 container.

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