CEL Overloads

The where field in rules and filters uses a customized version of the Common Expression Language (CEL). Unlike standard CEL which uses method-call syntax (e.g., field.contains()), UTMStack uses functional overloads that are safer and handle missing fields automatically.

Available Overloads

Core Features

  • Type Flexibility: Functions like equals and oneOf perform "best-effort" matching. They automatically handle comparisons between strings and numbers (e.g., equals("f", 100) will match both the integer 100 and the string "100").

  • Strict String Safety: Functions designed for string manipulation (startsWith, contains, regexMatch, etc.) strictly enforce that the field value must be a string. This prevents false positives on numeric or boolean fields.

  • Auto-Existence: If a field is missing, these functions return false instead of crashing or erroring the expression.

CategoryFunctionField Type (Log)Literal Type (Rule)Description
Existenceexists("f")AnyN/AChecks if a field exists.
Logicsafe("f", def)String, Num, BoolMatches FieldReturns field value or def if missing.
Flexible Matchequals("f", val)String, NumString, Int, Double"Best-effort" equality. Matches even if types differ (str vs num).
oneOf("f", [...])AnyList of AnyTrue if field matches any item using flexible matching.
Strict StringequalsIgnoreCase("f", "v")StringStringCase-insensitive equality.
(Scalar Only)contains("f", "v")StringString or ListTrue if field contains substring(s).
containsAll("f", [...])StringList of StringsTrue if field contains all substrings.
startsWith("f", "v")StringString or ListTrue if field starts with prefix(es).
endsWith("f", "v")StringString or ListTrue if field ends with suffix(es).
regexMatch("f", "re")StringString (Regex)Validates field against a regex.
NetworkinCIDR("f", "net")String (IP)String (CIDR)IPv4/v6 within a CIDR range.
ComparisongreaterThan("f", val)NumberString, Int, DoubleTrue if field > value (converts strings to num if possible).
lessThan("f", val)NumberString, Int, DoubleTrue if field < value.
greaterOrEqual("f", val)NumberString, Int, DoubleTrue if field < value.
lessOrEqual("f", val)NumberString, Int, DoubleTrue if field < value.
TemporalisHour("f", val)String (ISO8601)Int (0-23)True if hour matches val.
isMinute("f", val)String (ISO8601)Int (0-59)True if minute matches val.
isDayOfWeek("f", val)String (ISO8601)Int (0-6)True if day (0=Sun) matches val.
isWeekend("f")String (ISO8601)N/ATrue if Saturday or Sunday.
isWorkDay("f")String (ISO8601)N/ATrue if Monday to Friday.
isBetweenTime("f", "start", "end")String (ISO8601)String ("HH:MM")True if falls within range.

Example: Multi-Condition Detection

where: >
  exists("origin.ip") && 
  !inCIDR("origin.ip", "10.0.0.0/8") && 
  (startsWith("origin.user", "admin_") || equals("origin.user", "root"))