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

date(format)

Format date in UTC timezone using Golang Time Format

Examples