ip2long()

Converts any IPv4 address string to a numeric (long) type.

Syntax

ip2long(IP4_ADDR)
Required Parameters
IP4_ADDR
IPv4 address string expression. The function returns null if it receives an invalid value of any other type.

Usage

json "{}" | eval ip2long=ip2long("192.168.0.1") => 3232235521
json "{}" | eval ip2long=ip2long("127.0.0.1") => 2130706433
json "{}" | eval ip2long=ip2long("255.255.255.255") => 4294967295
json "{}" | eval ip2long=ip2long("256.256.256.256") => null