# Reload Logstash config on shutdown

**URL:** https://discuss.elastic.co/t/reload-logstash-config-on-shutdown/341545
**Category:** Logstash
**Created:** [August 24, 2023, 6:41am UTC](https://discuss.elastic.co/t/reload-logstash-config-on-shutdown/341545 "2023-08-24T06:41:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ljapunov](https://avatars.discourse-cdn.com/v4/letter/l/f4b2a3/32.png) [@Ljapunov](https://discuss.elastic.co/u/Ljapunov)
#### Post date: [August 24, 2023, 6:41am UTC](https://discuss.elastic.co/t/reload-logstash-config-on-shutdown/341545/1 "2023-08-24T06:41:45Z")

</div>

Hi everyone,

we have a multiple-node logstash cluster using a distributor pipeline that distributes events depending on their types, eg

```auto
input {
  beats {
      # ...
    }
  }
output {
    if [type] == "foo" {
      pipeline {
        send_to => foo
      }
    } else if [type] == "bar" {
      pipeline {
        send_to => bar
      }
   } else if [type] == "baz" {
      pipeline {
        send_to => baz
      }
  # ...

```

For this to work we need an entry in pipelines.yaml for every pipeline. Imagine this to be:

```auto
- pipeline.id: foo
  path.config: "/etc/logstash/conf.d/foo/*.conf"
- pipeline.id: bar
  path.config: "/etc/logstash/conf.d/bar/*.conf"

```

Here comes the problem I face. I somehow managed to add this new type "baz" to my input without specifying a pipeline for it in pipelines.yaml. This leads to some internal logstash-queues filling up and in the end block all events. In the logs I see

```auto
Attempted to send event to 'baz' but that address was unavailable. Maybe the destination pipeline is down or stopping? Will Retry.

```

Everything's fine so far. I can edit the pipelines.yaml and add my pipeline `baz` while logstash is running and the events get processed again.

But: On my first logstash-node I was too fast typing a `systemctl stop logstash`. Now it hangs in a shutdown because it tries to send the in-queue events to pipeline `baz` and it will not reload it's config now, after I added the missing pipeline to pipelines.yaml.

Is there something else I can do despite kill the process and lose events?  
Thank you so much for your answers!

---

<div class="post-metadata">

### Author: ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)
#### Post date: [August 24, 2023, 7:39am UTC](https://discuss.elastic.co/t/reload-logstash-config-on-shutdown/341545/2 "2023-08-24T07:39:17Z")

</div>

LS can reload .conf files for pipelines with the settings: `config.reload.automatic: true` but not own params from .yml. To reload .yml you have to restart LS.

---

<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: [August 24, 2023, 2:25pm UTC](https://discuss.elastic.co/t/reload-logstash-config-on-shutdown/341545/3 "2023-08-24T14:25:19Z")

</div>

> [@Ljapunov](#):
>
> Is there something else I can do despite kill the process and lose events?

Set ensure\_delivery to false, See the [documentation](https://www.elastic.co/guide/en/logstash/current/pipeline-to-pipeline.html#delivery-guarantees). That prevents the [code](https://github.com/danhermann/logstash/blob/20f5512103eee552d1f24caeb238cb405a83e19b/logstash-core/src/main/java/org/logstash/plugins/pipeline/PipelineBus.java#L67) looping forever.

---

<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: [September 21, 2023, 2:25pm UTC](https://discuss.elastic.co/t/reload-logstash-config-on-shutdown/341545/4 "2023-09-21T14:25:31Z")

</div>

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