Skip to content

Filters

You may want to prevent some events from being replicated. Those could be obsolete or “wrong” events, which your system doesn’t need.

Replicator provides two filters in addition to the special scavenge filter:

  • Event type filter
  • Stream name filter

Filter options:

OptionValuesDescription
typeeventType or streamNameOne of the available filters
includeRegular expressionFilter for allowing events to be replicated
excludeRegular expressionFilter for preventing events from being replicated

For example:

replicator:
filters:
- type: eventType
include: "."
exclude: "((Bad|Wrong)\w+Event)"

You can configure zero or more filters. Scavenge filter is enabled by the scavenge setting and doesn’t need to be present in the filter list. You can specify either include or exclude regular expression, or both. When both include and exclude regular expressions are configured, the filter will check both, so the event must match the inclusion expression and not match the exclusion expression.