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 = expr | Add a computed column |
sort {a, -b} | Order; minus is descending |
take N | First 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 col | Most / least frequent values, with counts |
search_all "text" | Full-text search over every field |
join, append, window, sessionize | Correlate, 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 ?? b | First value that is not null |
$key | A key from the event data |
Time (UTC)
@2026-11-24T02:47:19Z | A moment |
+ 10minutes, 2hours, 7days | Durations |
timestamp > ago "7 days" | Relative time |
earliest timestamp / latest timestamp | First and last seen in a group |
startofhour, startofday, bin s"hour" timestamp | Buckets |
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 names | A wrong field is refused with the closest known names |
Text, not numbers | nginx status codes are text: http_status_code == "200" |
Lists | process_args is a list: compare it as a list, not with ~= |
Arrows | Must return one row per record: no group or aggregate |