CEL Overloads

The where The field in rules and filters relies on a customized variant of the Common Expression Language (CEL). This differs from standard CEL, which uses method-call syntax (for example, field.contains()), Unified Security Stack uses functional overloads that are more secure and automatically manage absent fields.

Available Overloads

Core Features

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

  • Strict String Safety: Functions designed for string manipulation (startsWith, contains, regexMatch, and so on) strictly require the field value to be a string. This stops false positives on numeric or boolean fields.

  • Auto-Existence: If a field is missing, these functions return false rather than causing the expression to crash or produce an error.

CategoryFunctionField Type (Log)Literal Type (Rule)Description
Existenceexists("f")AnyN/AVerifies the presence of a field.
Logicsafe("f", def)String, Num, BoolMatches FieldProvides field value or def when absent.
Flexible Matchequals("f", val)String, NumString, Int, DoubleBest-effort equality. It matches even when types differ (str vs num).
oneOf("f", [...])AnyList of AnyTrue when field matches any item through flexible matching.
Strict StringequalsIgnoreCase("f", "v")StringStringPerforms case-insensitive equality comparison.
(Scalar Only)contains("f", "v")StringString or ListTrue when field holds one or more substrings.
containsAll("f", [...])StringList of StringsTrue when field holds every substring.
startsWith("f", "v")StringString or ListTrue when field starts with one or more prefixes.
endsWith("f", "v")StringString or ListTrue when field ends with one or more suffixes.
regexMatch("f", "re")StringString (Regex)Checks field against a regex.
NetworkinCIDR("f", "net")String (IP)String (CIDR)IPv4/v6 inside a CIDR range.
ComparisongreaterThan("f", val)NumberString, Int, DoubleTrue if field is greater than value (converts strings to num when possible).
lessThan("f", val)NumberString, Int, DoubleReturns true when the field is less than value.
greaterOrEqual("f", val)NumberString, Int, DoubleReturns true when the field is less than value.
lessOrEqual("f", val)NumberString, Int, DoubleReturns true when the field is less than value.
TemporalisHour("f", val)String (ISO8601)Int (0-23)Returns true when the hour matches val.
isMinute("f", val)String (ISO8601)Int (0-59)Returns true when the minute matches val.
isDayOfWeek("f", val)String (ISO8601)Int (0-6)True when day (0=Sun) equals val.
isWeekend("f")String (ISO8601)N/AReturns true for Saturday or Sunday.
isWorkDay("f")String (ISO8601)N/AReturns true for Monday through Friday.
isBetweenTime("f", "start", "end")String (ISO8601)String ("HH:MM")Returns true if within the specified 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"))