# Logstash.yml overwritten by Logstash and deleting comments?

**URL:** <https://discuss.elastic.co/t/logstash-yml-overwritten-by-logstash-and-deleting-comments/362186>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [June 28, 2024, 6:56am UTC](https://discuss.elastic.co/t/logstash-yml-overwritten-by-logstash-and-deleting-comments/362186 "2024-06-28T06:56:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fti](https://avatars.discourse-cdn.com/v4/letter/f/fbc32d/32.png) [@fti](https://discuss.elastic.co/u/fti)\
**Post date:** [June 28, 2024, 6:56am UTC](https://discuss.elastic.co/t/logstash-yml-overwritten-by-logstash-and-deleting-comments/362186/1 "2024-06-28T06:56:13Z")

</div>

Greetings.

I'm using the Logstash Docker image and I noticed something strange.

I created a bind mount in Docker on the `logstash.yml` file so that I could easily edit the configuration. I also enabled automatic configuration reload for convenience:

```auto
config.reload.automatic: true

```

This works fine but at some point (I don't know exactly when), Logstash seems to overwrite the configuration file. All options I wrote and their values are well preserved, but they seem to be reordered (alphabetical order?) and most importantly, all the # comments I wrote are removed...

The first times this happened, Logstash added this line in the file:

```auto
xpack.monitoring.enabled: ${xpack.monitoring.enabled}

```

I thought that maybe this was done because this line was both important and missing, but Logstash keeps editing the file even if that line already exists.

It is annoying to have my comments removed and I honestly see this as a bug unless someone can give me a good reason about why this is happening?
