isnotnull()

Table of Contents

Definition

isnotnull() takes a value and determines whether or not the value is null. If the value is NOT null, this function returns true.

Examples

The following example adds a new column 'NoNull' with eval and adds either 'yes' or 'no' values with if() function if the criteria is met in isnotnull() function. rex4j is used to extract customer IDs in the separate column.

index=sales_inventory earliest=-5y
| rex4j field=_raw "customerId=\"(?<customerId>[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+)"
| eval NoNull=if(isnotnull(customerId), "yes", "no")
| fields _time customerId NoNull
Screenshot of the previous example’s result

Further Reading