for_each

for_each #

CategoryScope
Frameworkbatch

Configuration #

FieldTypeDefaultDescription
message_fieldstring“messages”Context key holding the message batch.
parallelint1Runs the record sub-chain with N workers concurrently. Log workloads are order-insensitive — with a serial per-record cost of ~330µs, parallel: 4 measured ~2× end-to-end throughput. Processors must be safe for concurrent Process calls on distinct records (they mutate the record, never shared state); every in-repo record processor satisfies this. Cancellation still propagates from the parent context.
codecstringPayload codec used to decode/encode records (default otel).
on_failurestringSub-chain failure strategy: ignore, tag or fail.
failure_tagstring“_processing_failed”Tag appended to the record when on_failure is tag.
processorlist (processor configs)Ordered sub-chain of processors executed per record.

Example #

processor:
  - for_each:
      codec: otel
      on_failure: tag
      processor:
        - dissect:
            pattern: "%{log_level} %{message}"
        - if:
            equals:
              log_level: error
          then:
            - drop_event:
Edit Edit this page