Destination Filters
Destination filters allow tenants to selectively receive only events that match specific criteria. Instead of receiving all events for subscribed topics, a destination can define filters to route events based on their properties.
Overview
When an event is published, Outpost evaluates each destination's filter against the event. A destination receives an event only if:
- The destination is enabled
- The event's topic matches one of the destination's subscribed topics
- The event matches the destination's filter (or no filter is defined)
Filters are optional. Destinations without filters receive all events matching their subscribed topics.
Event Structure
Events have five top-level properties that can be filtered:
| Property | Description |
|---|---|
id | The event ID |
topic | The event topic |
time | Event timestamp (RFC 3339 format) |
metadata | Additional event information |
data | The event payload |
Your filter should specify one or more of these at the top level:
json
Exact Match
Specify the field path and value to match:
json
Multiple conditions are combined with AND logic:
json
Nested objects are supported:
json
Arrays
Arrays match if they contain the specified value:
json
This matches events like: { "tags": ["urgent", "support"] }
Operators
Use operators for complex matching.
Comparison Operators
| Operator | Description |
|---|---|
$eq | Equals |
$neq | Not equals |
$gt | Greater than |
$gte | Greater or equal |
$lt | Less than |
$lte | Less or equal |
Match orders over $100:
json
Multiple operators on the same field are combined with AND:
json
Membership Operators
| Operator | Description |
|---|---|
$in | Value in array, or substring match |
$nin | Value not in array |
Match specific statuses:
json
String Operators
| Operator | Description |
|---|---|
$startsWith | String starts with |
$endsWith | String ends with |
Match emails ending with a domain:
json
Field Existence Operator
| Operator | Description |
|---|---|
$exist | Field exists (true) or doesn't (false) |
Check if a field exists:
json
Check if a field doesn't exist:
json
Logical Operators
$or - Match any condition
json
$and - Match all conditions (explicit)
While multiple conditions are implicitly ANDed, $and is useful when you need to apply multiple conditions that can't be nested together:
json
$not - Negate a condition
json
Common Examples
Filter by Metadata
Route events based on source:
json
Filter by Time Range
Match events within a specific time window:
json
Filter by Numeric Value
Process only high-value orders:
json
API Usage
Filters are set when creating or updating a destination via the filter field:
sh
To remove a filter from a destination, set the filter field to an empty object:
sh
Portal Configuration
To enable destination filters in the tenant portal UI, set the PORTAL_ENABLE_DESTINATION_FILTER environment variable to true.