FilterItems
FilterItems
type: "io.kestra.plugin.core.storage.FilterItems"
Filter a file by retaining only the items that match a given expression.
Examples
tasks:
- id: filter
type: io.kestra.plugin.core.storage.FilterItems
from: "{{ inputs.file }}"
filterCondition: " {{ value == null }}"
filterType: EXCLUDE
errorOrNullBehavior: EXCLUDE
Properties
filterCondition
- Type: string
- Dynamic: ❌
- Required: ✔️
The 'pebble' expression used to match items to be included or excluded.
The 'pebble' expression should return a BOOLEAN value (i.e.
true
orfalse
). Values0
,-0
, and""
are interpreted asfalse
. Otherwise, any non empty value will be interpreted astrue
.
from
- Type: string
- Dynamic: ✔️
- Required: ✔️
The file to be filtered.
Must be a
kestra://
internal storage URI.
errorOrNullBehavior
- Type: string
- Dynamic: ❌
- Required: ❌
- Default:
FAIL
- Possible Values:
FAIL
INCLUDE
EXCLUDE
Specifies the behavior when the expression fail to be evaluated on an item or return null
.
Use
FAIL
to throw the exception and fail the task,INCLUDE
to pass the item through, orEXCLUDE
to drop the item.
filterType
- Type: string
- Dynamic: ❌
- Required: ❌
- Default:
INCLUDE
- Possible Values:
INCLUDE
EXCLUDE
Specifies the action to perform with items that match the filterCondition
predicate
Use
INCLUDE
to pass the item through, orEXCLUDE
to drop the items.
Outputs
droppedItemsTotal
- Type: integer
- Required: ❌
The total number of items that was dropped by the task.
processedItemsTotal
- Type: integer
- Required: ❌
The total number of items that was processed by the task.
uri
- Type: string
- Required: ❌
- Format:
uri
The filtered file URI.
Definitions
Was this page helpful?