-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Core/Infra/LoggingLog management and logging utilitiesLog management and logging utilities:Security/AuditX-Pack Audit loggingX-Pack Audit logging>enhancementTeam:Core/InfraMeta label for core/infra teamMeta label for core/infra teamTeam:SecurityMeta label for security teamMeta label for security team
Description
When audit logs are enabled they can generate a lot of data. We have been fighting with disk space issues regularly. It seems like all logs should gzip in the rotation by default since it will create fires that people will respond to in various ways depending on their understanding of log4j or even Elastic. Of course people need to adjust the logging to suite their needs, but a sane default would be nice.
Our solution was to use a block similar to this. Feel free to adopt it or share a recommendation.
appender.audit_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_audit-%d{yyyy-MM-dd}-%i.json.gz
appender.audit_rolling.policies.type = Policies
appender.audit_rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.audit_rolling.policies.time.interval = 1
appender.audit_rolling.policies.time.modulate = true
appender.audit_rolling.policies.size.type = SizeBasedTriggeringPolicy
appender.audit_rolling.policies.size.size = 128MB
appender.audit_rolling.strategy.type = DefaultRolloverStrategy
appender.audit_rolling.strategy.fileIndex = nomax
appender.audit_rolling.strategy.action.type = Delete
appender.audit_rolling.strategy.action.basepath = ${sys:es.logs.base_path}
appender.audit_rolling.strategy.action.condition.type = IfFileName
appender.audit_rolling.strategy.action.condition.glob = ${sys:es.logs.cluster_name}_audit*
appender.audit_rolling.strategy.action.condition.nested_condition.type = IfLastModified
appender.audit_rolling.strategy.action.condition.nested_condition.age = 7D
Thanks!
orjan
Metadata
Metadata
Assignees
Labels
:Core/Infra/LoggingLog management and logging utilitiesLog management and logging utilities:Security/AuditX-Pack Audit loggingX-Pack Audit logging>enhancementTeam:Core/InfraMeta label for core/infra teamMeta label for core/infra teamTeam:SecurityMeta label for security teamMeta label for security team