Skip to main content

Threat Detection ManagementThreat Detection Management Guide

Integer Operations Using Analytics Rule Syntax

Perform mathematical calculations and other operations involving integers using analytics rule syntax.

Function

Description

Returned Value

Examples

toNumber(expression)

Cast operation that converts the value of expression to an integer.

Integer

toNumber("42") returns 42

add(x1, ..., xn)

Adds numerical arguments x1 ... xn.

Integer

add(2, 3, 5) returns 10

subtract(xy)

Subtracts y from x.

Integer

subtract(5, 3) returns 2

multiply(x1, ..., xn)

Multiplies numerical arguments x1 ... xn.

An alternative form of mul().

Integer

multiply(2, 3, 5) returns 30

mul(x1, ..., xn)

Multiplies numerical arguments x1 ... xn.

An alternative form of multiply ().

Integer

mul(2, 3, 5) returns 30

divide(x, y)

Divides x by y.

An alternative form of div().

Integer

divide(10, 2) returns 5

div(x, y)

Divides x by y.

An alternative form of divide().

Integer

div(10,2) returns 5

power(x, y)

Raises x to the power of y.

An alternative form of pow().

Integer

power(2, 3) returns 8

pow(x, y)

Raises x to the power of y.

An alternative form of power().

Integer

pow(2, 3) returns 8

ceil(x)

Rounds x up to the nearest integer.

Integer

ceil(2.3) returns 3.

floor(x)

Rounds x down to the nearest integer.

Integer

floor(2.7) returns 2

round(x)

Rounds x to the nearest integer.

Integer

round(2.3) returns 2

round(2.7) returns 3

max(x1, ..., xn)

Evaluates the maximum of all arguments x1 ... xn.

Integer

max(1, 2, 3) returns 3

min(x1, ..., xn)

Evaluates the minimum of all arguments x1 ... xn.

Integer

min(1, 2, 3) returns 1

hextoInt("string")

Converts a string of a hexadecimal number into its integer equivalent.

Supports 'fff' or '0xfff' formats.

Integer

hextoInt("3a") returns 58