CEL Functions
Complete reference for all CEL functions available in source definitions
Respondent uses the Common Expression Language (CEL) to map API response fields to domain entities and observations. Every CEL expression receives a record variable – a map representing one parsed record from the API response.
All expressions are compiled at config load time and evaluated at runtime. Expressions are limited to 4096 bytes and 10,000 cost units to prevent abuse.
Time Functions
Functions for parsing timestamps from various API formats. All return a CEL timestamp.
now()2026-04-29T12:00:00Zunix_ms(record.time)record.time = 17143920000002024-04-29T12:00:00Zint64 or float64 input.unix_s(record.timestamp)record.timestamp = 17143920002024-04-29T12:00:00Zint64 or float64 input.parse_rfc3339(record.date)record.date = "2024-01-01T00:00:00Z"2024-01-01T00:00:00ZZ or +05:00).parse_iso8601(record.date)record.date = "2024-01-01T00:00:00"2024-01-01T00:00:00ZZ (UTC) if no timezone info is present. Useful for APIs like GDACS that omit timezone suffixes.parse_rfc2822(record.pubDate)record.pubDate = "Mon, 02 Jan 2006 15:04:05 -0700"2006-01-02T22:04:05Zparse_datetime(record.date, "2006-01-02 15:04:05")record.date = "2024-04-29 12:30:00"2024-04-29T12:30:00Z2006-01-02T15:04:05) as a format specification.Type Coercion
coerce_double(record.altitude, 0.0)record.altitude = "ground"0.0double. Handles float64, int64, string, and nil inputs. Returns the default value when conversion fails. Useful for APIs that return non-numeric strings for certain states (e.g., "ground" for altitude of grounded aircraft).Lookup Table Functions
Lookup tables are static key-value datasets defined inline or loaded from files. They are indexed at config time and queried in CEL expressions at runtime.
lookup_tables section. They are injected into an extended CEL environment at load time.lookup("airlines", record.iata, "name")record.iata = "AA""American Airlines"has_lookup("airlines", record.iata)record.iata = "XX"falsefalse if the table does not exist or the key is not found.lookup_or("airlines", record.iata, "name", "Unknown")record.iata = "XX""Unknown"Orbital (TLE/SGP4)
Functions for computing real-time satellite positions from Two-Line Element (TLE) sets using the SGP4 propagation model. Results are cached per (line1, line2, second) tuple, so calling all four functions for the same satellite incurs only a single propagation.
All SGP4 functions return 0.0 on error (malformed TLE, decayed orbit, etc.) rather than raising a runtime error.
sgp4_lat(record.line1, record.line2)TLE lines for ISS34.567sgp4_lon(record.line1, record.line2)TLE lines for ISS-118.234sgp4_alt_m(record.line1, record.line2)TLE lines for ISS408000.0sgp4_vel_mps(record.line1, record.line2)TLE lines for ISS7660.0Standard Built-ins
These are built-in CEL functions available in every expression.
has(record.lat)record = {"lat": 40.7}truehas() to guard optional fields – accessing a missing field without it causes a runtime error that silently skips the record.size(record.items)record.items = [1, 2, 3]3string(record.id)record.id = 42"42"int(val), double(val) for numeric conversion, and timestamp(val) for timestamp conversion.String Extensions
Provided by the cel-go string extension library. Called as methods on string values.
| Function | Example | Result |
|---|---|---|
split | "a,b,c".split(",") | ["a", "b", "c"] |
contains | "hello world".contains("world") | true |
startsWith | "hello".startsWith("hel") | true |
endsWith | "hello".endsWith("llo") | true |
trim | " hello ".trim() | "hello" |
lowerAscii | "HELLO".lowerAscii() | "hello" |
upperAscii | "hello".upperAscii() | "HELLO" |
Math Extensions
Provided by the cel-go math extension library. Functions are available in the math namespace.
| Function | Example | Result |
|---|---|---|
math.abs | math.abs(-5) | 5 |
math.ceil | math.ceil(2.3) | 3 |
math.floor | math.floor(2.7) | 2 |
math.round | math.round(2.5) | 3 |
math.least | math.least(3, 7) | 3 |
math.greatest | math.greatest(3, 7) | 7 |