Skip to content

Operators

Last updated View as MarkdownAgent setup

Arithmetic operators

Operator Description Example
+ Addition requests + 1
- Subtraction bytes - cachedBytes
* Multiplication requests * 100
/ Division bytes / requests
% Modulo edgeResponseStatus % 100
unary - Negation -1

The field types in a dataset determine which arithmetic operations are valid.

Comparison operators

Operator Description
= Equal to
!= or <> Not equal to
< Less than
<= Less than or equal to
> Greater than
>= Greater than or equal to

Logical operators

Operator Description
AND Both predicates are true.
OR At least one predicate is true.
NOT Negates a predicate.

Parentheses control evaluation order:

WHERE accountTag = '<ACCOUNT_TAG>'
  AND timestamp >= NOW() - INTERVAL '1' HOUR
  AND (edgeResponseStatus = 429 OR edgeResponseStatus >= 500)

Tenancy predicates are an exception. Keep accountTag and zoneTag predicates at the top level and join them with AND.

IN

Use IN or NOT IN to compare a scalar expression with a non-empty list:

edgeResponseStatus IN (403, 404, 429)

NOT IN is not supported for account or zone tenancy predicates.

BETWEEN

Use BETWEEN to test an inclusive range. NOT BETWEEN negates the test:

timestamp BETWEEN '2026-09-15T00:00:00Z' AND '2026-09-15T01:00:00Z'
edgeResponseStatus BETWEEN 400 AND 499

Pattern matching

Use LIKE and NOT LIKE for case-sensitive pattern matching. Use ILIKE and NOT ILIKE for case-insensitive matching. In a pattern, % matches any sequence of characters and _ matches one character.

clientRequestHttpHost ILIKE 'api.%'

LIKE ... ESCAPE is not supported.

Null predicates

Use IS NULL or IS NOT NULL to test whether an expression is null:

originResponseStatus IS NOT NULL

This does not make a standalone NULL literal valid in other expressions.

CASE

The SQL API supports searched and simple CASE expressions:

CASE
  WHEN edgeResponseStatus >= 500 THEN 'server error'
  WHEN edgeResponseStatus >= 400 THEN 'client error'
  ELSE 'other'
END

CASE edgeResponseStatus
  WHEN 200 THEN 'ok'
  ELSE 'other'
END

Was this helpful?