isNaN and isInfinity
The isNaN and isInfinity operators check a numeric string and return a boolean value.
- isNaN returns
true
if the string value is not a number,false
otherwise. - isInfinity returns
true
if the string value is a positive or negative infinity,false
otherwise.
Syntax
isNaN("<string>") as <field>
isNaN(<string_field>) [as <field>]
isInfinity("<string>") as <field>
isInfinity(<string_field>) [as <field>]
Examples
| 5/0 as infinity
| isInfinity(infinity) as boolean
Returnsboolean
astrue
.
- | parse "has * total tokens" as total_token
| where !isNaN(total_token)
Returns results wheretotal_token
values are a number.