---
title: "EventWolf filters"
description: "Learn the filter language EventWolf uses in history queries, live tails, subscriptions, and replays, in JSON and as query parameters."
url: "https://agentpost.tools/docs/eventwolf/concepts/filters"
kind: concept
---

# Filters

A filter chooses [events](/docs/eventwolf/concepts/events.md). The same language serves every place EventWolf picks events: a history read, a live tail, a [subscription](/docs/eventwolf/concepts/subscriptions.md), and a [replay](/docs/eventwolf/concepts/replays.md). An empty filter matches every event.

## Clauses

An event matches when it meets every clause the filter has. Where a clause takes a list, any value in the list matches.

| Clause | Matches |
| --- | --- |
| `types` | The event’s `type`: exact; with a trailing `.*`, every type below it, so `request.*` matches `request.created` but not `request`; or `*` for every type. |
| `sources` | The event’s `source`: exact, or a prefix with one trailing `*`, such as `/support/*`. |
| `refs` | Any of its references, each `{ type, id }`, or `{ type }` for every reference of that type. |
| `workspace` | Its `workspace` extension, exactly. |
| `subject` | Its `subject`, exactly. |
| `extensions` | Each named extension’s value, or any of a list of values, such as `{ "severity": ["high", "urgent"] }`. |
| `where` | The value at each data path, or any of a list of values, such as `{ "assignee.id": "u_ana" }`. |

A filter is checked when it is saved or sent, and an invalid one is refused. A path or extension an event doesn’t have never matches, so a filter fails closed. Each value matches by exact equality, such as a status or an ID, and a list matches any of its values.

## In a query string

A history read and a live tail take the filter as query parameters, such as `GET /v1/events/events?types=request.*&ref=request:r_9&where[assignee.id]=u_ana`:

-   **`types`** and **`sources`:** comma-separated, such as `types=request.created,request.resolved`.
-   **`ref`:** `type:id`, or a type alone. Repeat it for any of several.
-   **`workspace`** and **`subject`:** one value each.
-   **`ext[<name>]`** and **`where[<path>]`:** a value, or comma-separated values. `true` and `false` are booleans. Decimal numbers such as `-2` and `0.5` are numbers. Forms such as `01` and `1e3` stay strings.

A subscription, a replay, and a subscription test take the filter as JSON, in `filter`.

## Limits

-   `types` and `sources` hold at most 50 patterns each, and `refs` at most 20.
-   `where` names at most 10 data paths.
-   A list of values holds at most 100.

## Where to act on it

-   The [EventWolf quickstart](/docs/eventwolf/quickstart.md) reads a history by reference and tests a filter.
-   [List events](/docs/eventwolf/reference/events.md#list-events), [Stream events](/docs/eventwolf/reference/events.md#stream-events), and [Test a subscription](/docs/eventwolf/reference/subscriptions.md#test-a-subscription).
