to_number - Administrator Guide - Cortex XSIAM - Cortex - Security Operations

Cortex XSIAM Documentation

Product
Cortex XSIAM
Creation date
2024-03-06
Last date published
2024-10-13
Category
Administrator Guide
Abstract

Learn more about the Cortex Query Language to_number() function that converts a string to a number.

Syntax
to_number (<string>)
Description

The to_number() function converts a string that represents a number to a floating point number. This function is identical to the to_float function.

Examples

Display the first 10 IP addresses that begin with a value greater than 192. Use the split function to split the IP address by '.', and then use the arrayindex function to retrieve the first value in the resulting array. Convert this to a number and perform an arithmetic compare to arrive at a result set.

dataset = xdr_data 
| fields action_local_ip  as alii 
| filter to_number(arrayindex(split(alii, "."),0))  > 192 
| limit 10