len()

Returns the length of the string. If the argument is null, it returns 0, and if it receives a value other than the string, it evaluates the value after converting it to a string.

Syntax

len(STR_EXPR)
Required Parameter
STR_EXPR
String expression

Usage

json "{}" | eval length=len("sample") => 6

json "{}" | eval length=len(null) => 0

json "{}" | eval length=len(123) => 3

json "{}" | eval length=len(1.2) => 3