Mathematical functions and operations

Several tasks such as Aggregator, Condition, and Notification are empowered by an extended mathematical editor that supports a powerful set of mathematical functions and operations.

Mathematical functions

Most probably you are already familiar with them and used these ones in SQL databases, Microsoft Excel, or Google Spreadsheets.

Array functions

Single number functions

Other functions

Metric functions

Also, there's an additional set of functions available for Metrics only:

Arithmetical and logical operations

The following list is supported:

Arithmetic

+ - / * % **

Comparison

== === != !== > < >= <= >== <==

Boolean operators

|| && !

Bitmasking

| & ^ << >>

Regular expression comparison

The following two operations are supported for searching in strings with regular expressions

=~ // means a regular expression match is found !~ // means a regular expression match is not found

For example, the following string placed in the Condition or Aggregator will return true

"Mountaineering is the best sport in the world. Or engineering?" =~ "[(Engin|Mountain)]eering\\s"

Supported syntax for regular expressions: https://pkg.go.dev/regexp/syntax.

Formatting of dates

Comparison operations can also be used for comparing dates. The following formats are supported:

  • time.UnixDate,

  • time.RubyDate,

  • time.Kitchen,

  • time.RFC3339,

  • time.RFC3339Nano,

  • "2006-01-02", // RFC 3339

  • "2006-01-02 15:04", // RFC 3339 with minutes

  • "2006-01-02 15:04:05", // RFC 3339 with seconds

  • "2006-01-02 15:04:05-07:00", // RFC 3339 with seconds and timezone

  • "2006-01-02T15Z", // ISO8601 with hour without UTC offset

  • "2006-01-02T15:04Z", // ISO8601 with minutes without UTC offset

  • "2006-01-02T15Z0700", // ISO8601 with hour

  • "2006-01-02T15:04:05Z", // ISO8601 with seconds without UTC offset

  • "2006-01-02T15:04Z0700", // ISO8601 with minutes

  • "2006-01-02T15:04:05Z0700", // ISO8601 with seconds

  • "2006-01-02T15:04:05.999999999Z", // ISO8601 with nanoseconds without UTC offset

  • "2006-01-02T15:04:05.999999999Z0700", // ISO8601 with nanoseconds

Last updated