# Logstash log4j2.properties gets overriden by rpm

**URL:** <https://discuss.elastic.co/t/logstash-log4j2-properties-gets-overriden-by-rpm/102983>\
**Category:** Logstash\
**Created:** [October 6, 2017, 9:42am UTC](https://discuss.elastic.co/t/logstash-log4j2-properties-gets-overriden-by-rpm/102983 "2017-10-06T09:42:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guirlande](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@Guirlande](https://discuss.elastic.co/u/Guirlande)\
**Post date:** [October 6, 2017, 9:42am UTC](https://discuss.elastic.co/t/logstash-log4j2-properties-gets-overriden-by-rpm/102983/1 "2017-10-06T09:42:14Z")

</div>

We've got an issue with logstash package when updating it.

There are the version informations that would be useful about OS :

- RedHat 7.4
- LogStash 5.5.1

After a yum update and logstash is updated, if log4j2.properties was modified by user, we are in this situation.

Expected result:  
$ ls /etc/logstash  
conf.d jvm.options log4j2.properties log4j2.properties.rpmnew patterns startup.options

Where log4j2.properties is the modified file, not overwritten, and log4j2.properties.rpmnew the file that is presented by the RPM package.

Result:  
$ ls /etc/logstash  
conf.d jvm.options log4j2.properties patterns startup.options

Where log4j2.properties is the new file.

To verify where is specifically the issue :  
$ rpm -qpc logstash-5.5.1.rpm  
/etc/logstash/jvm.options  
/etc/logstash/logstash.yml  
/etc/logstash/startup.options

The expected result would be the following :  
$ rpm -qpc logstash-5.5.1.rpm  
/etc/logstash/jvm.options  
/etc/logstash/log4j2.properties  
/etc/logstash/logstash.yml  
/etc/logstash/startup.options

Proposed solution:

- Having the log4j2.properties to be declared as a configuration file in the RPM package.

The issue is similar to [Logstash log4j2.properties gets overriden by dpkg](https://discuss.elastic.co/t/logstash-log4j2-properties-gets-overriden-by-dpkg/90290)

---

<div class="post-metadata">

**Author:** ![jakelandis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jakelandis/32/36163_2.png) [@jakelandis](https://discuss.elastic.co/u/jakelandis)\
**Post date:** [October 6, 2017, 2:01pm UTC](https://discuss.elastic.co/t/logstash-log4j2-properties-gets-overriden-by-rpm/102983/2 "2017-10-06T14:01:59Z")

</div>

@Guirlande - I believe that this was fixed in [https://github.com/elastic/logstash/pull/7688/files](https://github.com/elastic/logstash/pull/7688/files) (the changed referenced by the issue you linked to)

---

<div class="post-metadata">

**Author:** ![Guirlande](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@Guirlande](https://discuss.elastic.co/u/Guirlande)\
**Post date:** [October 9, 2017, 12:01pm UTC](https://discuss.elastic.co/t/logstash-log4j2-properties-gets-overriden-by-rpm/102983/3 "2017-10-09T12:01:22Z")

</div>

Indeed, this was fixed in the commit. I haven't dug far enough, I should have checked more.  
I check the 5.6.0 version of the package, and the file /etc/logstash/log4j2.properties is listed as a configuration file as expected.

Thanks for your answer anyway 🙂

---

<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:** [November 6, 2017, 12:01pm UTC](https://discuss.elastic.co/t/logstash-log4j2-properties-gets-overriden-by-rpm/102983/4 "2017-11-06T12:01:26Z")

</div>

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