Filtering, drop or reject


What is it?

The Filtering plugin can reject data, which prevents it from advancing in the pipeline, based on a condition.

Installation

This plugin is already integrated into the Satellite package, so you can’t require it with composer.

Usage

Dropping a line

For example, this will ignore the line if the field “identifier” is missing, using the array expression keyExists:

- filter:
    drop:
      - when: '@=!keyExists("identifier", input)'

Rejecting a line

This is equivalent to dropping a line, but when paired with a rejection configuration you will be able to log information about the dropped line.

This will ignore a line where the field “image” is empty, and store that data in some destination:

- filter:
    reject:
      - when: '@=input["identifier"] === null'
    rejection:
      destinations:
        # ...