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') }}"
resources:
- FLOW
- EXECUTIONThe maximum date to be purged
All audit logs older than this date will be purged. We recommend using this property rather than startDate as your Audit Log retention policy.
Namespace for which audit logs should be purged
This property declares a namespace prefix (or namespace of a specific flow if flowId is also provided) to be purged.
AUDITLOGAPPAPP_EXECUTIONBLUEPRINTBINDINGDASHBOARDEXECUTIONFLOWKV_STOREGROUPINVITATIONNAMESPACENAMESPACE_FILEROLESECURITY_INTEGRATIONSECRETSETTINGTEMPLATETRIGGERTENANTTENANT_ACCESSTESTSUITETESTSUITE_RUNVERSIONED_PLUGINUSERWORKER_GROUPINSTANCEUNKNOWNThe resources to be purged
The resources of audit logs to be purged; by default, the task will purge all audit logs including all resources.
The minimum date to be purged
All audit logs created after this date will be purged. Use this option only if you want to purge recently generated logs after a certain date.
READCREATEUPDATEDELETELOGINLOGOUTIMPERSONATELOGIN_FAILUREACCOUNT_LOCKEDThe 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.
0The count of deleted audit logs