Skip to main content
Version: v1.6.0

Functions


Functions appear in expression context and take Zed values as arguments and produce a value as a result.

  • abs - absolute value of a number
  • base64 - encode/decode base64 strings
  • bucket - quantize a time or duration value into buckets of equal widths
  • cast - coerce a value to a different type
  • ceil - ceiling of a number
  • cidr_match - test if IP is in a network
  • compare - return an int comparing two values
  • coalesce - return first value that is not null, a "missing" error, or a "quiet" error
  • crop - remove fields from a value that are missing in a specified type
  • error - wrap a value as an error
  • every - bucket ts using a duration
  • fields - return the flattened path names of a record
  • fill - add null values for missing record fields
  • flatten - transform a record into a flattened map
  • floor - floor of a number
  • grep - search strings inside of values
  • has - test existence of values
  • has_error - test if a value has an error
  • is - test a value's type
  • is_error - test if a value is an error
  • join - concatenate array of strings with a separator
  • kind - return a value's type category
  • ksuid - encode/decode KSUID-style unique identifiers
  • len - the type-dependent length of a value
  • levenshtein Levenshtein distance
  • log - natural logarithm
  • lower - convert a string to lower case
  • missing - test for the "missing" error
  • nameof - the name of a named type
  • network_of - the network of an IP
  • now - the current time
  • order - reorder record fields
  • parse_uri - parse a string URI into a structured record
  • parse_zson - parse ZSON text into a Zed value
  • pow - exponential function of any base
  • quiet - quiet "missing" errors
  • regexp - perform a regular expression search on a string
  • replace - replace one string for another
  • round - round a number
  • rune_len - length of a string in Unicode code points
  • shape - apply cast, fill, and order
  • split - slice a string into an array of strings
  • sqrt - square root of a number
  • trim - strip leading and trailing whitespace
  • typename - look up and return a named type
  • typeof - the type of a value
  • typeunder - the underlying type of a value
  • under - the underlying value
  • unflatten - transform a record with dotted names to a nested record
  • upper - convert a string to upper case