
Core Plugins and tasks PurgeLogs
CertifiedPurge execution and trigger logs.
Core Plugins and tasks PurgeLogs
Purge execution and trigger logs.
Deletes logs in bulk by namespace/flow/execution filters and optional level/date ranges. Requires namespace authorization when targeting other namespaces.
For performance, use this instead of per-execution deletions; consider keeping ERROR logs by filtering logLevels.
type: io.kestra.plugin.core.log.PurgeLogsExamples
Purge all logs that has been created more than one month ago.
id: purge
namespace: system
tasks:
- id: purge_logs
type: io.kestra.plugin.core.log.PurgeLogs
endDate: "{{ now() | dateAdd(-1, 'MONTHS') }}"
Purge all logs that has been created more than one month ago, but keep error logs.
id: purge
namespace: system
tasks:
- id: purge
type: io.kestra.plugin.core.log.PurgeLogs
endDate: "{{ now() | dateAdd(-1, 'MONTHS') }}"
logLevels:
- TRACE
- DEBUG
- INFO
- WARN
Properties
endDate *string
The maximum date to be purged
All logs before this date will be purged.
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150batchSize integerstring
The number of log rows deleted per batch
Only applies on MySQL. When set, deletion runs in batches of this size using DELETE ... LIMIT n to stay within group_replication_transaction_size_limit. When not set, all matching rows are deleted in a single transaction.
executionId string
The Execution ID of the logs to be purged
flowId string
The flow ID of the logs to be purged
You need to provide the namespace property if you want to purge flow logs.
logLevels array
ERRORWARNINFODEBUGTRACEThe levels of the logs to be purged
If not set, log for all levels will be purged.
namespace string
Namespace of logs that need to be purged
If flowId isn't provided, this is a namespace prefix, else the namespace of the flow.
purgeExecutionLogs booleanstring
trueWhether to purge execution logs
If set to true, logs attached to an execution will be purged. Default is true.
purgeNonExecutionLogs booleanstring
trueWhether to purge non-execution logs
If set to true, logs not attached to an execution (e.g. trigger logs) will be purged. Default is true.
startDate string
The minimum date to be purged
All logs after this date will be purged.
Outputs
count integer
0The total count of deleted logs
executionLogsCount integer
0The count of deleted execution logs
nonExecutionLogsCount integer
0The count of deleted non-execution logs