Skip to main content
An expression performs functions, and mathematical and/or logical operations on other primitives and field’s values to return a result; similar to expressions in a spreadsheet. You can use various functions in Calculated Field formulas. Functions operate within the context of a single event, meaning that each function takes field values from an event and produces a new Calculated Field attached to that event.

Field names

Reference fields, or columns, by prefixing their name with a dollar sign $.
Field names that start with a number or contain spaces must be enclosed in double quotes ".

Literals

Strings

String literals are enclosed in double quotes ("a string") and support interpretation. Special characters are escaped with a backslash \. Within the quotes, any character may appear except newline ("\n") and unescaped double quote ("\\") which require the use of the backslash character.

Raw strings

Raw string literals are enclosed in single back ticks (`a raw string`). Within the quotes, any character may appear except a back quote. This is useful for expression of text that use the backslash character. For example, file paths and regular expressions.

Integers and floating point numbers

Positive or negative whole numbers or floating point numbers. E notation style numbers are also supported.

Booleans

A truthy value represented with true and false false.

Null

An empty, missing value represented with null.

Operators

Calculated fields support infix arithmetic, logical, and comparison operators. Add spaces around infix operators, otherwise your expression may not evaluate how you expect. For example:
  • $column+5 returns the value of a field named column+5.
  • $column + 5 returns the sum of five and the column field’s value.

Arithmetic operators

Sum, subtraction, multiplication, division, and modulo infix operators are supported.

Comparison operators

Logical operators

Infix operators for conditional AND, conditional OR, and logical NOT.

Functions

A function’s name is all-capitalized. Function arguments (if any) are enclosed in parenthesis. Field names, literal values, and other functions are valid function arguments.