Skip to main content
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.
This reads the last 7 days of request logs, keeps the failed requests, counts them per client IP along with how many endpoints each IP hit, and returns the 20 noisiest IPs. The time range is part of the query: see Time range.
Not sure how to write it? Click Write with AI, describe what to find, and Clarion writes the query for you to review and run.

Time range

A query sets its own time range with a where 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 as src_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

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.
This lists the IP addresses that show up in more than one of your logs.

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.
The default innerunique keeps one left row per key, as in Sentinel. If you expect several left rows to match, write kind=inner.
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:
Find AWS principals making write calls they have never made before:
In the console you can also query a baseline on its own:
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, write alice_laptop.ip:
A reference is an entity followed by a dot and one of its attributes. When the query runs, Clarion reads the values from the Brain and shows, next to the results, which entity each reference read and when it was last seen. Open the Brain tab in the console to browse entities and copy the exact reference for each one.

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:
A column always wins over an entity of the same name. If an entity’s handle clashes with a column, name it with its kind instead.

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 inside in (...), !in (...) or has_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:
Scripts hammering the login page:
Error rate per hour:
Clients forwarded through a proxy:
Slowest-to-download routes, by the 95th percentile of response size:

GitHub

Who cloned the most repositories:
Destructive and access-changing actions:
One token used from many IP addresses:

Okta

Password spraying: one IP failing sign-ins for many users:
MFA fatigue: bursts of push notifications to one user:
Sign-ins through anonymizing proxies, or flagged by ThreatInsight:
Privilege grants:

AWS CloudTrail

Principals hitting access denied:
Console sign-ins without MFA:
Tampering with CloudTrail itself:
Calls from another AWS account:

S3 logs

Search fields your mapping leaves out through raw:

Across sources

IPs that failed Okta sign-ins and also sent requests to your apps:
GitHub activity from IPs that never signed in to Okta:

With the Brain

Everything one person’s laptops did on your apps:
Super admins signing in from outside the country:
AWS calls made from your production instances:
One device, named exactly:
A person’s activity across GitHub and Okta, when the Brain has linked both accounts to them:

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:
  • let statements, 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-series or render.
  • summarize ... by bin=, and nulls first / nulls last in sorts.
  • union kinds other than the default outer.
  • has and has_any with 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.