ip2int()

Converts an IPv4 address object or IPv4 address string to a signed integer.

Syntax

ip2int(IP4_ADDR)
Required Parameters
IP4_ADDR
Expression that returns an IPv4 address string or IPv4 address object. The function returns null if it receives an invalid value of any other type.

Usage

json "{}" | eval ip2int=ip2int("192.168.0.1") => -1062731775
json "{}" | eval ip2int=ip2int("127.0.0.1") => 2130706433
json "{}" | eval ip2int=ip2int("255.255.255.255") => -1
json "{}" | eval ip2int=ip2int("256.256.256.256") => null