Skip to main content
where decides which rows a query returns. It reads like the sentence you would say out loud: services on port 80 or 443 whose page title mentions admin becomes
A filter is a tree built from four kinds of items. You can mix them freely:

Condition

{ "field", "op", "value" } tests one field: port in [80, 443].

Group

{ "logic": "and" | "or", "items": [...] } combines items, like parentheses.

Not

{ "not": <item> } keeps the rows the item does not match.

Relation test

{ "relation": "services", … } asks about a list of related rows as a whole: has none, all of them, at least five.
The filter always runs inside your workspace: no combination of or and not can reach beyond it.

Conditions

string
required
A field of the resource (port), of a related row (http.title, target.value), or of a list (technologies.name, see Conditions on a list).
string
required
The operator. Which ones a field accepts depends on its type: see Operators.
string | string[]
Always strings, even for numbers and booleans ("443", "true"). An array for the list operators (in, notIn, inSubnet, notInSubnet, containsAll, containsAny), a pair [from, to] for between, and nothing at all for isNull / isNotNull.
A value that does not fit the field — "abc" for a port, "urgent" for a severity, "fe80::1%eth0" for an IP — is refused before anything runs, with the path of the faulty value.

Groups, nesting and not

The top of a where is always a group. Inside it, a group can hold conditions and other groups, up to four levels deep, so any boolean expression can be written down. Admin or login pages that are not on a development host:
  • not wraps any item: a condition, a group or a relation test.
  • A filter holds at most 50 conditions (20 for the AI agent and MCP). Relation tests count as one condition each.
Filters written before nesting existed use "conditions" instead of "items" in inner groups ({ "logic": "or", "conditions": [...] }). That form still works.

Operators

  • between includes both ends: port between ["1", "1024"] matches 1 and 1024.
  • Lists of strings (cve, tags…): eq / in match when the list contains that element, containsAny when it shares at least one element with your array, containsAll when it holds every element of it.
contains, startsWith and endsWith on large text fields (value, url, http.title, finding name) cost more than eq or in. Prefer exact values when you have them.

Empty values

Some fields can be empty: a service with no HTTP response has no http.title, a finding may have no cvssScore, a host never seen by a scan has no lastSeen. Every such field accepts two extra operators, which take no value:
An empty value never matches a positive operator and always matches a negative one (neq, notIn, notContains, notInSubnet): a service without a title is not in contains "admin", and is in notContains "admin". To leave those rows out, add isNotNull on the same field.

Conditions on a list

A condition on a field of a list (technologies.name on services, vulnerabilities.severity on hosts) looks at the related rows:
  • A positive operator means “has at least one related row that matches”.
  • A negative operator (neq, notIn, notContains) means “has no related row that matches”.
This is the quick form. When you need several conditions on the same related row, or anything other than “at least one”, use a relation test.

Relation tests

A relation test asks a question about a whole list of related rows.
string
required
A list of the resource (services on hosts), or one reached through related rows (host.vulnerabilities on services).
"some" | "none" | "every"
default:"some"
  • some: at least one related row matches where. Without where: the row has any related row at all.
  • none: no related row matches where. Without where: the row has no related rows.
  • every: every related row matches where (required here). A row with no related rows passes.
object
{ "op": "eq" | "neq" | "gt" | "gte" | "lt" | "lte", "value": "<n>" }: compares the number of related rows (those matching where, if given) with a number. Use either quantifier or count, not both.
object
A filter on the related rows. Its fields are the related resource’s own: port, not services.port. It cannot contain another list.
Unlike a condition on a list, every condition inside one relation test applies to the same related row:
A relation test reads the related resource, so it needs that resource’s permission: a test on vulnerabilities requires vulnerability.read, even when the query only returns hosts.
A filter selects parent rows; it does not change which children an include returns. To get only matching children, put the same condition in the include’s own where (see Composing queries).

Time expressions

A time value is one of:

Time windows

A window keeps the rows whose time field falls in [since, until). It is the short way to say recent:
  • On the batch, a window applies to every query that does not set its own. On a query, it overrides the batch’s.
  • "window": null on a query reads all time, even when the batch has a window.
  • No window at all means all time.
  • The window applies to the resource’s firstSeen by default; "windowField": "lastSeen" uses another time field (hosts seen by a scan this week).
  • until defaults to now and cannot be more than a day in the future.
  • rollups has no time field: give it "window": null when the batch has a window.
firstSeen is when OASM first recorded the row, lastSeen when a scan last reported it. New this week is a window on firstSeen; still alive this week is a window on lastSeen. The isNew field is different again: the row was found by the latest finished run of its workflow on that target (the “new” badge of the console).