ChronusQLFundamentals

Queries, fields, and expressions

Project JSON fields, name results, calculate values, and filter events with predictable expression semantics.

Fundamentals

9 min read

Language reference

Query anatomy

Row transformationChronusQL
SELECT device.id AS device_id,
       ABS(reading - target) AS deviation
INTO alerts
FROM sensors TIMESTAMP BY ts
WHERE reading IS NOT NULL
  AND ABS(reading - target) >= 5
  1. 01
    FROM

    Selects the physical input or CTE that produces records.

  2. 02
    TIMESTAMP BY

    Resolves the event-time value used by temporal operators.

  3. 03
    WHERE

    Removes records before projection or grouping.

  4. 04
    SELECT

    Builds the output object and assigns aliases.

  5. 05
    INTO

    Routes the result to a named output stream.

Field paths and aliases

Use dot-separated paths for nested JSON. A leading input name or alias qualifies ownership, while the remaining segments locate the value. AS controls the emitted field name; bracketed aliases can target output names that contain punctuation.

FormMeaning
readingTop-level field from the current input.
device.location.zoneNested JSON path.
t.speedField qualified by input alias t.
value AS readingEmit the value under a new field name.
event.data AS [event.name]Emit a supported bracketed output alias.
SELECT *Preserve the complete current record.

Operators and predicates

FamilySupported forms
Arithmetic+, -, *, /, %, unary -
Comparison=, <>, !=, >, >=, <, <=, !>, !<
LogicalAND, OR, NOT, parentheses
Set and rangeIN (...), NOT IN (...), BETWEEN, NOT BETWEEN
TextLIKE, NOT LIKE
NullIS NULL, IS NOT NULL
ScalarABS(expression)
Composed predicateChronusQL
SELECT ts, sensor_id, reading
INTO output
FROM input TIMESTAMP BY ts
WHERE sensor_id IN ('A', 'B', 'C')
  AND reading BETWEEN 20 AND 80
  AND status NOT LIKE 'offline%'