Skip to main content

Typing Operations

isbool

Description: Takes an input parameter and returns true if the parameter is a boolean, otherwise false.

In the example, res will be false, res1 will be true, res2 will be false, res3 will be true, res4 will be true.

Example #1
... | eval res=isbool("true"), res1=isbool(true), res2=isbool("123"), res3=isbool(false), res4=isbool(tobool("hello"))

isint

Description: Takes an input parameter and returns true if the parameter is an integer, otherwise false.

In the example, res will be false, res1 will be true.

Example #1
... | eval res=isint("123"), res1=isint(123)

isnotnull

Description: Takes an input parameter and returns true if the parameter is not null, otherwise false.

In the example, res will be true, res1 will be false.

Example #1
... | eval res=isnotnull("123"), res1=isnotnull(null)

isnull

Description: Takes an input parameter and returns true if the parameter is null, otherwise false.

In the example, res will be false, res1 will be true.

Example #1
... | eval res=isnull("123"), res1=isnull(null)

isnum

Description: Takes an input parameter and returns true if the parameter is a number, otherwise false.

In the example, res will be false, res1 will be true.

Example #1
... | eval res=isnum("123"), res1=isnum(123)

isstr

Description: Takes an input parameter and returns true if the parameter is a string, otherwise false.

In the example, res will be true, res1 will be false.

Example #1
... | eval res=isstr("123"), res1=isstr(123)

typeof

Description: Takes an input parameter and returns its type.

In the example, res will be "String", res1 will be "Integer", res2 will be "Boolean".

Example #1
... | eval res=typeof("123"), res1=typeof(123), res2=typeof(true)