abs()

Returns the absolute value of any number.

Syntax

abs(NUM_EXPR)
Required Parameters
NUM_EXPR
Expression that returns int, short, long, float, and double. This returns null when it receives an argument value that is not a number.

Usage

json "{}" | eval abs=abs(-1) => 1

json "{}" | eval abs=abs(1) => 1

json "{}" | eval abs=abs(-1.234) => 1.234

json "{}" | eval abs=abs(1 – 43) => 42