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
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.or and not can reach beyond it.
Conditions
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).The operator. Which ones a field accepts depends on its type: see Operators.
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."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 awhere 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:
notwraps 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.
Operators
betweenincludes both ends:port between ["1", "1024"]matches 1 and 1024.- Lists of strings (
cve,tags…):eq/inmatch when the list contains that element,containsAnywhen it shares at least one element with your array,containsAllwhen it holds every element of it.
Empty values
Some fields can be empty: a service with no HTTP response has nohttp.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:
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”.
Relation tests
A relation test asks a question about a whole list of related rows.A list of the resource (
services on hosts), or one reached through related rows (host.vulnerabilities on services).some: at least one related row matcheswhere. Withoutwhere: the row has any related row at all.none: no related row matcheswhere. Withoutwhere: the row has no related rows.every: every related row matcheswhere(required here). A row with no related rows passes.
{ "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.A filter on the related rows. Its fields are the related resource’s own:
port, not services.port. It cannot contain another list.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.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": nullon 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
firstSeenby default;"windowField": "lastSeen"uses another time field (hosts seen by a scan this week). untildefaults tonowand cannot be more than a day in the future.rollupshas no time field: give it"window": nullwhen 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).