eval - Evaluate Expression

Evaluate an expression.

- command: eval <expression>
  [extractKey: <key>]

Argument

Description

expression

Expression to evaluate

key

Key in which to store the evaluated expression value

Supported operators:

Operator

Description

+

Addition, concatenation

-

Subtraction, Negation

/

Division

*

Multiplication

**

Power

%

Modulo

&

Bitwise And

|

Bitwise Or

^

Bitwise Xor

~

Bitwise Not

>>

Right shift

<<

Left shift

!

Inversion

&&

Logical And

||

Logical Or

?

Ternary True

:

Ternary False

??

Null coalescence

>

Greater than

<=

Less than or equal

>=

Greater than or equal

==

Equal

=~

Regex match

!~

Regex mismatch

Supported functions:

Function

Description

bytes(val1 [, val2] [, ...])

Convert an array of bytes to a string.

numeric(value [, unit])

Convert value to a numeric value. Optional unit for converting measurement results

utcTime([format])

Returns the current UTC timestamp. If a format parameter is provided, the date is returned in the specified format using the Golang Time Format. If no format is provided, the date defaults to YYYY-MM-DD.

Examples