# Old logs are not getting compressed

**URL:** <https://discuss.elastic.co/t/old-logs-are-not-getting-compressed/307029>\
**Category:** Elasticsearch\
**Created:** [June 13, 2022, 12:30pm UTC](https://discuss.elastic.co/t/old-logs-are-not-getting-compressed/307029 "2022-06-13T12:30:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giri\_Dharan1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/giri_dharan1/32/106932_2.png) [@Giri\_Dharan1](https://discuss.elastic.co/u/Giri_Dharan1)\
**Post date:** [June 13, 2022, 12:30pm UTC](https://discuss.elastic.co/t/old-logs-are-not-getting-compressed/307029/1 "2022-06-13T12:30:26Z")

</div>

I'm using the below code to delete and roll(compress) old logs

######## Server - old style pattern ###########  
appender.rolling\_old.type = RollingFile  
appender.rolling\_old.name = rolling\_old  
appender.rolling\_old.fileName = ${sys:es.logs.base\_path}${sys:file.separator}${sys:es.logs.cluster\_name}.log  
appender.rolling\_old.layout.type = PatternLayout  
appender.rolling\_old.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] [%node\_name]%marker %m%n

appender.rolling\_old.filePattern = ${sys:es.logs.base\_path}${sys:file.separator}${sys:es.logs.cluster\_name}-%d{yyyy-MM-dd}-%i.log.gz  
appender.rolling\_old.policies.type = Policies  
appender.rolling\_old.policies.time.type = TimeBasedTriggeringPolicy  
appender.rolling\_old.policies.time.interval = 1  
appender.rolling\_old.policies.time.modulate = true  
appender.rolling\_old.policies.size.type = SizeBasedTriggeringPolicy  
appender.rolling\_old.policies.size.size = 10MB  
appender.rolling\_old.strategy.type = DefaultRolloverStrategy  
appender.rolling\_old.strategy.fileIndex = nomax  
appender.rolling\_old.strategy.action.type = Delete  
appender.rolling\_old.strategy.action.basepath = ${sys:es.logs.base\_path}  
appender.rolling\_old.strategy.action.condition.type = IfFileName  
appender.rolling\_old.strategy.action.condition.glob = ${sys:es.logs.cluster\_name}\*  
appender.rolling\_old.strategy.action.condition.nested\_condition.type = IfAny  
appender.rolling.strategy.action.condition.nested\_condition.type = IfAccumulatedFileSize  
appender.rolling.strategy.action.condition.nested\_condition.exceeds = 50MB  
appender.rolling\_old.strategy.action.condition.nested\_condition.type = IfLastModified  
appender.rolling\_old.strategy.action.condition.nested\_condition.age = 99D

###############################################

Files of names are getting deleted and compressed as well, but Elasticsearch-rf-qa\_access-2021-12-26.log not getting compressed. Am I missing something?

1. Elasticsearch-rf-qa-2021-12-21-1.json
2. Elasticsearch-rf-qa-2021-12-21-1.log
3. Elasticsearch-rf-qa\_access-2021-12-26.log

---

<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:** [July 11, 2022, 12:30pm UTC](https://discuss.elastic.co/t/old-logs-are-not-getting-compressed/307029/2 "2022-07-11T12:30:53Z")

</div>

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