# Config.reload.automatic ignored on Logstash Docker container

**URL:** <https://discuss.elastic.co/t/config-reload-automatic-ignored-on-logstash-docker-container/166399>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [January 30, 2019, 4:31pm UTC](https://discuss.elastic.co/t/config-reload-automatic-ignored-on-logstash-docker-container/166399 "2019-01-30T16:31:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shirakaba](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@shirakaba](https://discuss.elastic.co/u/shirakaba)\
**Post date:** [January 30, 2019, 4:31pm UTC](https://discuss.elastic.co/t/config-reload-automatic-ignored-on-logstash-docker-container/166399/1 "2019-01-30T16:31:09Z")

</div>

# Setup

## Docker details

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

Image: `docker.elastic.co/logstash/logstash:6.3.2`.

I'm using the [https://github.com/deviantony/docker-elk](https://github.com/deviantony/docker-elk) repo to compose the Docker services.

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

```auto
logstash:
  build:
    context: logstash/
    args:
      # $ELK_VERSION is 6.3.2
      ELK_VERSION: $ELK_VERSION
  volumes:
    - ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml:ro
    - ./logstash/pipeline:/usr/share/logstash/pipeline:ro
  ports:
    - "127.0.0.1:5000:5000"
    - "127.0.0.1:5044:5044"
  environment:
    LS_JAVA_OPTS: "-Xmx2g -Xms2g"

    # Should (but doesn't in practice) reload logstash.conf every 3 seconds.
    # https://github.com/spujadas/elk-docker/issues/174
    # https://www.elastic.co/guide/en/logstash/current/reloading-config.html
    LS_OPTS: "--config.reload.automatic"
  networks:
    - elk
  depends_on:
    - elasticsearch

```

## `logstash.yml`

```auto
---
## Default Logstash configuration from logstash-docker.
## from https://github.com/elastic/logstash-docker/blob/master/build/logstash/config/logstash-oss.yml
http.host: "0.0.0.0" # The default
path.config: /usr/share/logstash/pipeline

```

## `logstash.conf`

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](https://www.elastic.co/guide/en/logstash/current/reloading-config.html), 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.

# Conclusion

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](https://discuss.elastic.co/t/config-reload-automatic-for-logstash-docker-container/153727)

# [Changing logstash config in docker container](https://discuss.elastic.co/t/changing-logstash-config-in-docker-container/131138)

---

<div class="post-metadata">

**Author:** ![cptcanuck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cptcanuck/32/11693_2.png) [@cptcanuck](https://discuss.elastic.co/u/cptcanuck)\
**Post date:** [January 31, 2019, 8:20pm UTC](https://discuss.elastic.co/t/config-reload-automatic-ignored-on-logstash-docker-container/166399/2 "2019-01-31T20:20:22Z")

</div>

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.

---

<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:** [February 28, 2019, 8:20pm UTC](https://discuss.elastic.co/t/config-reload-automatic-ignored-on-logstash-docker-container/166399/3 "2019-02-28T20:20:28Z")

</div>

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