step

filter

Filter events based on field conditions with AND/OR logic.

Overview

Filter events based on field conditions with AND/OR logic. This step evaluates conditions against event data and drops events that don't match. Conditions within a group are ANDed together (all must be true), while different groups are ORed (any group can pass). This allows for complex filtering logic like "premium users OR verified users with high scores". The step supports 12 operators including equality, comparisons, string matching, and field existence checks. Optionally inject the filter result into the event for downstream inspection. Events that fail all filter groups are dropped from the workflow entirely.

Quick Start

steps:
- type: filter
  groups: []

Configuration

Parameter Type Required Description
groups array Yes Ordered list of AND-groups evaluated with logical OR. The first matching group allows the event to continue downstream.
output_to string No Optional key used to store {'passed': bool, 'groups': List[bool]} describing the filter evaluation. Leave unset to skip annotations.
inject string No DEPRECATED: Use 'output_to' instead. Optional key for storing filter evaluation metadata.

Examples

Simple equality filter

Only pass events where user status is 'active'

type: filter
groups:
  - conditions:
      - field: user.status
        op: eq
        value: active

Multiple conditions with AND

Pass events where user is verified AND age >= 18

type: filter
groups:
  - conditions:
      - field: user.verified
        op: eq
        value: true
      - field: user.age
        op: gte
        value: 18
output_to: filter_result

Multiple groups with OR logic

Pass if user is admin OR moderator (either role works)

type: filter
groups:
  - conditions:
      - field: user.role
        op: eq
        value: admin
  - conditions:
      - field: user.role
        op: eq
        value: moderator

String matching filters

Filter emails from a specific domain

type: filter
groups:
  - conditions:
      - field: user.email
        op: endswith
        value: "@company.com"

Complex business logic

Premium users OR (verified users with score >= 80)

type: filter
groups:
  - conditions:
      - field: user.tier
        op: eq
        value: premium
  - conditions:
      - field: user.verified
        op: eq
        value: true
      - field: user.score
        op: gte
        value: 80
inject: filter_result

Field existence check

Only process events that have a payment_id field

type: filter
groups:
  - conditions:
      - field: payment_id
        op: exists
        value: true

Advanced Options

These options are available on all steps for error handling and retry logic:

Parameter Type Default Description
retries integer 0 Number of retry attempts (0-10)
backoff_seconds number 0 Backoff (seconds) applied between retry attempts
retry_propagate boolean false If True, raise last exception after exhausting retries; otherwise swallow.