From e910de0a066dcf719300336990648de1a2597ea2 Mon Sep 17 00:00:00 2001 From: reyesj2 <94730068+reyesj2@users.noreply.github.com> Date: Thu, 16 Oct 2025 16:19:55 -0500 Subject: [PATCH] update log4j2 policy for ES json output Signed-off-by: reyesj2 <94730068+reyesj2@users.noreply.github.com> --- salt/elasticsearch/files/log4j2.properties | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/salt/elasticsearch/files/log4j2.properties b/salt/elasticsearch/files/log4j2.properties index 305069882..45d3d852b 100644 --- a/salt/elasticsearch/files/log4j2.properties +++ b/salt/elasticsearch/files/log4j2.properties @@ -35,7 +35,12 @@ appender.rolling_json.policies.time.type = TimeBasedTriggeringPolicy appender.rolling_json.policies.time.interval = 1 appender.rolling_json.policies.time.modulate = true appender.rolling_json.strategy.type = DefaultRolloverStrategy -appender.rolling_json.strategy.max = 1 +appender.rolling_json.strategy.action.type = Delete +appender.rolling_json.strategy.action.basepath = /var/log/elasticsearch +appender.rolling_json.strategy.action.condition.type = IfFileName +appender.rolling_json.strategy.action.condition.glob = *.json.gz +appender.rolling_json.strategy.action.condition.nested_condition.type = IfLastModified +appender.rolling_json.strategy.action.condition.nested_condition.exceeds = 1D rootLogger.level = info rootLogger.appenderRef.rolling.ref = rolling