Log query language
Search, filter, group and chart your organisation's request log with one line, in the console's Requests page, alerts, the live feed and the admin API.
One line searches the request log. It reads like GitHub search (field:value, - to exclude, words side by side mean AND), with Datadog-style ranges and @ shortcuts, and LogQL-style pipes to aggregate. The same language runs in four places:
| Where | What it accepts |
|---|---|
Requests (/requests) |
everything on this page |
Alerts (/alerts) |
a search without time terms and without pipes |
Live feed (/live) |
a search without time terms, pipes or content terms |
Admin API, GET /api/admin/v1/logs/query |
everything; see the cloud API pages of this section (Venom Cloud) |
Examples
| Query | Finds |
|---|---|
timeout |
any request whose id, model, key, daemon, provider, error code, session or route mentions "timeout" |
"rate limit exceeded" |
an exact phrase |
model:gpt-5.5 status:5xx |
server errors on one model (asked for or served) |
model:gpt-* -model:gpt-4* |
a wildcard, minus another |
model:(gpt-5.5 OR glm-5.3) latency:>2s |
either model, slower than 2 s |
status:429 since:15m |
rate limited in the last 15 minutes |
key:laptop OR key:ci-* |
one key or a family of keys |
user:alice@example.com @today |
a person's key, since local midnight |
daemon:gpu-box ttft:<300ms |
fast first tokens on one daemon |
served:cloud provider:openai cost:>$0.05 |
expensive requests the cloud sent to OpenAI |
tokens:>10k is:error |
big requests that failed |
latency:1s..5s route:venom-default |
a latency band on one route alias |
-served:direct has:content |
relayed requests with stored prompts |
since:2026-10-01 until:2026-10-02 |
one whole day, in the query's time zone |
@yesterday | count by model |
yesterday's requests per model |
status:error | count by error | sort count desc | limit 10 |
the ten commonest errors |
| p95(latency), p50(ttft) by provider |
latency percentiles per provider |
| top 5 model by sum(cost) |
the five costliest models |
| timeseries 5m count by status |
requests per status in 5-minute buckets |
latency:>5s | sort latency desc | limit 50 |
the 50 slowest requests |
prompt:"refund policy" |
requests whose stored prompt says that (needs content:read) |
tool:web_search has:image |
requests that called a tool and sent an image |
messages:>20 | p95(prompt_chars) by model |
prompt size of long conversations, per model |
Grammar
query = [ search ] { "|" stage } ;
search = or ;
or = and { "OR" and } ;
and = unary { [ "AND" ] unary } ; (* side by side is AND *)
unary = ( "NOT" | "-" ) unary | primary ;
primary = "(" or ")" | term ;
term = phrase | macro | field_term | word ;
phrase = '"' { char | '\"' | '\\' } '"' ;
macro = "@" name ; (* @today, @yesterday, ... *)
field_term = [ "-" ] field ":" value_part ;
value_part = phrase
| "(" value { [ "OR" ] value } ")" (* field:(a OR b) *)
| cmp value (* field:>2s *)
| value ".." value | value ".." | ".." value
| value { "," value } ; (* field:429,500 *)
cmp = ">" | ">=" | "<" | "<=" | "=" ;
stage = stats | top | timeseries | sort | limit | fields ;
stats = [ "stats" ] agg { "," agg } [ by ] ;
agg = "count" | fn "(" field ")" [ "as" name ] ;
fn = "sum" | "avg" | "min" | "max" | "p50" | "p75" | "p90" | "p95" | "p99" | "median" | "distinct" ;
by = "by" field { "," field } ; (* at most 3 *)
top = "top" [ int ] field [ "by" agg ] ; (* default 10, by count *)
timeseries = ( "timeseries" | "ts" | "chart" ) [ duration ] [ agg { "," agg } ] [ "by" field ] ;
sort = ( "sort" | "order" ) [ "by" ] key [ "asc" | "desc" ] { "," key [ "asc" | "desc" ] } ;
limit = ( "limit" | "head" | "take" ) int ;
fields = ( "fields" | "columns" | "select" ) field { "," field } ;NOTand-bind tightest, then AND, thenOR.a b OR cis(a b) OR c. Parentheses group.OR,ANDandNOTare upper case. A lower-caseoris searched as a word, with a warning and a fix.- Before the first
|, a word runs to whitespace, a parenthesis, a quote or a pipe, sosince:2026-10-01T09:30,cost:>$0.05andstatus:429,500are single words. - Field names are case-insensitive, and
-equals_(served-modelisserved_model). Values match case-insensitively. - A query is at most 4,000 characters.
- Free text (a bare word or phrase) matches a substring of the request id, model, served model, error code, key name, daemon name, provider, session id, route reason or fallback reason. A bare word may use
*and?; a phrase is literal. The log holds error codes, not error messages.
Fields
| Field | Aliases | Type | Notes |
|---|---|---|---|
model |
m |
text | asked for or served |
served_model |
served-model, upstream_model |
text | what actually ran |
base_model |
priced_as |
text | what the served model was priced as |
price_source |
priced_by |
text | custom, provider, builtin, none |
route |
alias |
text | the route alias in the request body |
key |
k, user, u, apikey, api_key |
ref | key name, or a uuid for the key id |
team |
ref | the key group (name, or a uuid for its id) | |
org |
tenant, organisation, organization |
ref | operator only |
member |
owner, person |
text | the org member the key belongs to |
gear |
preset |
text | the x-venom-gear header |
role |
gear_role |
text | the x-venom-role header (workers, smart, summary, ...) |
project |
proj |
text | x-venom-project, else the key's project |
task |
pr, issue |
text | x-venom-task, canonical (acme/web#123, ENG-142) |
tier |
service_tier |
text | flex, priority, batch, auto, default |
session |
sess |
text | |
id |
request, req, request_id |
text | |
path |
endpoint |
text | |
kind |
api |
text | chat, responses, completions, embeddings, rerank, decisions, other |
source |
origin |
text | quality_check, shadow_eval, shadow, slack; client requests have none |
daemon |
d, node, host |
ref | |
provider |
upstream, p |
text | |
served |
served_by, via |
enum | cloud, daemon, direct, relay |
region |
geo |
text | the daemon's region |
reason |
route_reason |
text | |
fallback |
fallback_reason |
text | |
status |
s, code, http |
status | |
error |
err, error_code |
text | |
attempts |
tries |
int | |
latency |
duration, lat, dur, elapsed |
duration | |
ttft |
first_token, ttfb |
duration | time to first token |
route_ms |
routing |
duration | |
tokens |
tok, t |
count | in + out |
tokens_in |
input, in, prompt_tokens |
count | |
tokens_out |
output, out, completion_tokens |
count | |
cached |
cached_tokens, cache |
count | |
cost |
spend, usd, price |
money | |
saved |
saved_usd, savings |
money | what the service tier saved against list price (negative on priority) |
is |
flag | error, ok, fallback, retried, public, witnessed, cloud, daemon, direct, relay, byok, quality_check, shadow_eval, shadow, slack, background, partial |
|
has |
flag | filter, content, image, tools, session, error, fallback, cache, cost |
|
tool |
tools, tool_name, tool_call |
text, list | tool names the model called; any one matches |
messages |
msgs, msg_count, turns |
int | system and developer messages not counted |
prompt_chars |
prompt_len |
count | characters of prompt text |
response_chars |
response_len |
count | characters of generated text |
finish |
finish_reason, stop_reason |
text | |
filter |
filters, rule, prompt_filter |
text, list | a prompt filter rule that matched |
filter_action |
filtered |
text, list | redact, block, warn, log |
filter_direction |
filter_side |
text, list | request or response |
guardrail |
guardrails, gr |
text, list | a guardrail code that fired |
prompt |
request_body, input_text |
content | stored prompt text (content search) |
response |
output_text, completion, answer |
content | stored response text |
content |
body |
content | either |
since |
from, after, start |
time | window |
until |
to, before, end |
time | |
last |
past, within |
time |
user: is an alias of key:: a request carries the key that sent it, not a person, so name keys after their people (alice@example.com laptop) and user:alice* reads naturally.
tool, messages, prompt_chars, response_chars and finish are read once from a stored body and kept next to it, as names and sizes only. They need only logs:read, work in aggregations (| count by tool), and exist only for requests whose content was stored.
Values
| Type | Forms | Comparisons |
|---|---|---|
| text | gpt-5.5, gpt-* (* any run, ? one character), "with spaces" (literal), a,b, (a OR b) |
none |
| ref | as text, or a uuid that matches the id | none |
| enum, flag | one of the listed words | none |
| status | 429, 5xx, error (status ≥ 400 or an error code), ok |
>, >=, <, <=, ranges |
| duration | 250ms, 2s, 1.5m, 1h (s, sec, m, min, h, hr, d, w); a bare number is ms |
all |
| count | 1200, 10k, 2.5m, 1b, 1_000 |
all |
| money | $0.05 or 0.05 (US dollars) |
all |
| int | 3 |
all |
Ranges include both ends: latency:1s..5s; latency:1s.. is at least, latency:..5s at most. A comma list or a group is OR within one field. -field:value keeps rows with no value for the field (-daemon:gpu-box keeps cloud-served requests).
The time window
Every query reads a bounded window.
- No time term: the last 24 hours, labelled "last 24h (default)".
since:<point>,until:<point>,last:<duration>. A point is a duration ago (15m,24h,7d,2w,2h ago,now), a date (2026-10-01, midnight in the query's zone) or a date-time (2026-10-01T09:30local;…Zor…+08:00absolute).- Macros:
@today,@yesterday,@thisweek(since Monday),@lastweek,@thismonth,@hour,@day,@week. - Time zone: the browser's zone in the console (or UTC, one click); the
tzparameter (an IANA name, default UTC) in the API. - Time terms belong to the whole query: never inside
OR,NOTor parentheses. When there are several, the last wins. untilis never later than now. An empty window is an error; one longer than 90 days is cut to its last 90 days.
Pipes
| Stage | Example | Result |
|---|---|---|
count / stats |
| count by model, | stats sum(cost), p95(latency) by key |
a table, one row per group (at most 3 group fields) |
top |
| top 5 key by sum(cost) |
the top N groups (default 10, by count) |
timeseries (ts, chart) |
| timeseries 5m count by status |
a chart; the bucket is picked for you when omitted |
sort (order) |
| sort latency desc |
rows or table rows in that order |
limit (head, take) |
| limit 50 |
at most N rows or groups |
fields (columns, select) |
| fields time, status, model, key |
rows with those columns |
Aggregate functions: count, sum, avg, min, max, p50, p75, p90, p95, p99, median, distinct. as name renames a column. Money comes back in US dollars, durations in ms.
Limits
| Default | Cap | |
|---|---|---|
| rows per page | 50 | 500 |
groups (count by, top) |
100 (top: 10) |
1,000 |
| timeseries points | about 60 to 120 | 1,000 (a smaller bucket is raised) |
| timeseries groups | 10 by total, the rest as (other) |
|
| paging with a custom sort | 10,000 rows | |
| window | 24 h | 90 days |
| statement time | 5 s, then 504 query_timeout |
|
| content rows opened per page | 500 |
Content search
prompt:, response: and content: search the stored, sealed bodies. They work only when:
- you have
content:read(owner, admin, developer), else403 content_forbidden; - the query covers one org (an operator must pick one), else
400 content_needs_org; - the org logs content (the default), else
409 content_logging_off; - the deployment has
VENOM_VAULT_KEYS, else503 vault_not_configured.
Bodies can't be searched in SQL, so the server applies every other filter first, then opens up to 500 candidate rows per page, newest first, and keeps the ones whose text matches. A page can hold fewer rows than the limit; load more to scan further. Matching rows show a 160-character snippet. Content terms must stand alone at the top level (ANDed, optionally negated like -response:sorry), never inside OR and never with an aggregation. Each search writes one content.searched audit row with the fields and counts, never the search text.
Diagnostics
The query bar marks problems as you type, and a query with an error does not run. Each problem has a stable code, a message and often a fix: a typo in a field, value, macro, stage or function gets "did you mean", and an unknown field with nothing close offers to search the word as a phrase.
| Code | Meaning |
|---|---|
unknown_field, unknown_macro, unknown_stage, unknown_function |
a name the language doesn't know |
missing_value, invalid_value, invalid_operator |
a field term is incomplete or doesn't fit the field's type |
unclosed_paren, unterminated_quote, dangling_or, dangling_and, dangling_not |
broken structure |
nested_window, negated_time |
a time term inside OR, NOT or parentheses |
not_groupable, not_aggregatable, not_sortable, too_many_groups |
the stage can't use that field |
fields_with_aggregation, aggregation_first, one_aggregation, timeseries_by |
stages combined in a way that doesn't work |
too_long |
over 4,000 characters |
operator_only |
org: by anyone but the operator |
content_forbidden, content_placement, content_aggregation |
a content term without permission, inside OR, or with a pipe |
window_clamped, empty_window, invalid_tz |
the window was cut to 90 days, is empty, or the zone is unknown |
lowercase_keyword, duplicate_window, limit_capped (warnings) |
the query runs, but probably not as meant |
Canonical form and links
The console rewrites what you typed into its canonical form: canonical field names, - for negation, one space, the window last before the pipes, values normalised (2000ms is 2s, 10000 is 10k). Saved queries and links store that text, so equal queries share one link: /requests?q=model%3Agpt-5.5+status%3A5xx&tz=Europe%2FBerlin.
Who sees which rows
The scope comes from who you are, never from the query, and is applied before your expression, so an OR can't widen it:
| Caller | Rows |
|---|---|
| org member | their org's |
legacy key group member or key group admin key (vak_) |
their key group's |
| operator | every org's, or one org when picked |
In the live feed, members without org:manage (developers, viewers) see only requests from their own keys.
Related
- Log queries over the admin API: the same queries from scripts (run, page, facet, save), the results' shapes and the errors.
- Requests and request traces: the explorer itself, export and content logging.
- Alerts: run a search every 5 minutes.
- Sessions and live activity: the live feed.