Purge audit logs older than a certain date.
This task can be used to save space in the database by purging audit logs older than a certain date.
type: "io.kestra.plugin.ee.core.log.PurgeAuditLogs"
Purge audit logs older than one month.
id: audit_log_cleanup
namespace: system
tasks:
- id: purge_audit_logs
type: io.kestra.plugin.ee.core.log.PurgeAuditLogs
description: Purge audit logs older than 1 month
endDate: "{{ now() | dateAdd(-1, 'MONTHS') }}"
Purge audit logs related to FLOW & EXECUTION permission created more than one month ago.
id: "purgeauditlogs"
type: "io.kestra.plugin.ee.core.log.PurgeAuditLogs"
endDate: "{{ now() | dateAdd(-1, 'MONTHS') }}"
permissions:
- FLOW
- EXECUTION
YES
The maximum date to be purged.
All auditlogs older than this date will be purged. We recommend using this property rather than startDate
as your Audit Log retention policy.
YES
Namespace for which audit logs should be purged.
A namespace prefix or namespace of a specific flow if flowId
is also provided.
NO
FLOW
BLUEPRINT
TEMPLATE
NAMESPACE
EXECUTION
USER
GROUP
ROLE
BINDING
AUDITLOG
SECRET
KVSTORE
IMPERSONATE
SETTING
INFRASTRUCTURE
APP
APPEXECUTION
ME
APITOKEN
DASHBOARD
TENANT
UNKNOWN
The permissions to be purged.
The permissions of audit logs to be purged; by default, the task will purge all audit logs including all permissions.
YES
The minimum date to be purged.
All auditlogs created after this date will be purged. Use this option only if you want to created recently generated logs after a certain date.
NO
READ
CREATE
UPDATE
DELETE
LOGIN
LOGOUT
IMPERSONATE
LOGIN_FAILURE
ACCOUNT_LOCKED
The type of CRUD actions to be purged.
Use this option if you want to purge only specific actions like CREATE, READ, UPDATE, or DELETE. By default, the task will purge all types of actions.
0
The count of deleted audit logs.