Arcsentry · AQL

One line: join stages with |. Several lines: one stage per line, no |. A stage cannot span two lines.

Stages

filter <cond>Keep matching rows (after a group: keep groups)
select {a, b = expr}Choose columns; select !{a} drops one
derive x = exprAdd a computed column
sort {a, -b}Order; minus is descending
take NFirst N rows (take A..B for a range)
group {k} (aggregate {n = count this})One row per value
aggregate {…}One row over everything
top N col / rare N colMost / least frequent values, with counts
search_all "text"Full-text search over every field
join, append, window, sessionizeCorrelate, stack, running values, sessions

Operators

== != < > <= >=Compare; == null is "not recorded"
&& || !And, or, not
col ~= "(?i)a[.]b"Regex anywhere; (?i) ignores case; [.] is a dot
col in ("a", "b")One of several values
a ?? bFirst value that is not null
$keyA key from the event data

Time (UTC)

@2026-11-24T02:47:19ZA moment
+ 10minutes, 2hours, 7daysDurations
timestamp > ago "7 days"Relative time
earliest timestamp / latest timestampFirst and last seen in a group
startofhour, startofday, bin s"hour" timestampBuckets

Patterns

filter event_type == "logs_nginx" | top 10 remote_addr
filter event_type == "logs_nginx" && http_method == "POST" | rare 5 url
filter event_type == "logs_nginx" | group {remote_addr} (aggregate {n = count this, first = (earliest timestamp), last = (latest timestamp)}) | sort {-n}
filter event_type == "linux_auditd" && user_id == "33"
filter timestamp >= @2026-11-24T02:47:19Z && timestamp < @2026-11-24T02:47:19Z + 10minutes

SQL

SELECT http_status_code, count(*) AS n
FROM scope
GROUP BY http_status_code
ORDER BY n DESC

One SELECT or WITH statement, read-only, from the table scope (host, event types and time already applied).

Gotchas

Field namesA wrong field is refused with the closest known names
Text, not numbersnginx status codes are text: http_status_code == "200"
Listsprocess_args is a list: compare it as a list, not with ~=
ArrowsMust return one row per record: no group or aggregate
venemalabs.com/training · Full lessons and reference: venemalabs.com/docs