Clarion stores the logs your monitors send and lets you query them with KQL, the Kusto Query Language used by Microsoft Sentinel and Azure Data Explorer. You write queries on the Detect → Logs page. Agents run the same language through the Query Request Logs tool, and detectors use it to describe what they look for.
Your first query
A query starts with a table and pipes it through operators with|. Each operator takes the rows from the one before it.
Time range
A query sets its own time range with awhere on time_dt right after its table:
The range picker next to Run is a shortcut for the same thing: picking Last 7 days writes
| where time_dt > ago(7d) after the table, and Custom range writes a between. If you write a different time condition yourself, the picker shows Set in query.
A condition sets the range only when it comes before any other operator, joined to the rest with and. Anywhere else, such as after a summarize or inside an or, it filters rows but doesn’t widen what is read, so the table is read over the last 24 hours.
When a query reads several tables, each has its own range. A where time_dt right after a union applies to every table it stacks. In a join, each side sets its own, so you can match the last hour of Okta failures against a week of requests:
Detectors are the exception. A detector runs on every window its schedule sets, so its query can’t set a time range of its own, and saving one that does is refused.
Tables
The Fields panel in the console lists every column of every table, with its type and a description. Start typing in the editor and it suggests tables, columns, operators and functions.
Shared columns
Columns follow OCSF attribute names, so one name means the same thing in every table. A dotted name such assrc_endpoint.ip is a single column: write it as is, with no quotes or brackets.
Not every table has every shared column; the Fields panel shows which. A field an event doesn’t carry reads as empty text, so test for it with
isnotempty() rather than isnotnull().
Table-specific columns
requests
requests
github_audit
github_audit
okta
okta
cloudtrail
cloudtrail
s3_logs
s3_logs
Operators
Comparing values
Text comparisons ignore case unless the operator ends in
_cs, except ==, != and in, which are exact.
Literals
Functions
bin(time_dt, 1h) rounds a time down to the hour, which is how you chart activity over time with summarize ... by bin(time_dt, 1h). make_set() keeps at most 100 distinct values. Dividing two whole numbers gives a whole number, so wrap one in todouble() to get a ratio.
Combining logs
union
union stacks rows from several tables, lining columns up by name. Because the shared columns have the same name everywhere, one query can read all your sources at once. A table without a column reads it as empty. withsource=<name> adds a column naming each row’s table.
join
join matches rows of the query so far (the left side) with rows of another query (the right side). Join on columns with the same name with on name, or on differently named ones with on $left.a == $right.b. List several keys separated by commas.
When both sides have a column of the same name, the right side’s copy gets a number appended. Because that new name isn’t a known column, quote it with brackets when it has a dot:
project ['src_endpoint.ip1'].
Baselines
A baseline table holds what is normal for each actor, computed every day from the 30 whole days before your time range starts. Because the window being searched is never part of its own baseline, joining to one finds behavior that is new.active_days is how many days in the lookback had any activity for that pair; 1 means a one-off. In CloudTrail, principal is the role ARN for an assumed-role session, so every session of a role counts as one principal, and action is event_source:metadata.event_code, such as iam.amazonaws.com:CreateAccessKey.
Find GitHub users touching a repository they haven’t worked in for the past month:
A detector can read a baseline only as the right side of a join that keeps the log’s rows:
leftouter, inner, innerunique, leftsemi or leftanti. Starting a query from a baseline works in the console and for agents.Brain references
You can name anything the Brain has discovered directly in a query, and Clarion fills in the values it holds. Instead of copying a laptop’s IP addresses into a query, writealice_laptop.ip:
Naming an entity
The kinds are
compute, datastore, network, service, repository, dns, monitor, scope, kubeCluster, identity, device, mcpServer, package, vulnerability, secret, accessControl, compliance, ai, technology, pipelineDefinition and other.
A filter compares an attribute with text using ==, =~, contains or startswith, and joins comparisons with and. An entity matches when any of its values for the attribute matches:
Attributes
If you name an attribute an entity has no value for, the error lists the attributes it does hold.
Rules
- One value, or a list. Compared with
==or!=, a reference must hold exactly one value. A reference that holds several, like a laptop with two IP addresses or every super admin’s email, goes insidein (...),!in (...)orhas_any (...). The error tells you which to use. - Up to 100 values per reference.
- Recent and discovered only. A query can name assets an integration discovered and has seen in the last 30 days. Assets inferred from log contents can’t be named, because anyone who can write to your logs could choose their names.
- Exactly one match. If a handle matches no entity, or several, the query doesn’t run, and the error lists the candidates to choose from.
- Your workspace only. References read only your workspace’s Brain, and never change it.
Examples
Web traffic
Attack payloads in requests that weren’t blocked:GitHub
Who cloned the most repositories:Okta
Password spraying: one IP failing sign-ins for many users:AWS CloudTrail
Principals hitting access denied:S3 logs
Search fields your mapping leaves out throughraw:
Across sources
IPs that failed Okta sign-ins and also sent requests to your apps:With the Brain
Everything one person’s laptops did on your apps:Limits
Not supported
Clarion compiles KQL to its own log store, and refuses anything it doesn’t support with an error pointing at the exact spot:letstatements, and more than one statement per query. Write one query that starts with a table.- Operators other than those listed in Operators, such as
parse,mv-expand,make-seriesorrender. summarize ... by bin=, andnulls first/nulls lastin sorts.unionkinds other than the defaultouter.hasandhas_anywith anything other than quoted text.- Looking up a map by position:
http_request.http_headers["user-agent"]works,http_request.http_headers[0]doesn’t.