parse_ip

Description

When the input is an IPv(4/6) address, returns a JSON object containing the following attributes - family (either “4” or “6”), host (passed host IP), ip_fields (Array of 4 32-bit integers each representing 32 bits from the given IP), ip_type (always “inet”), netmask_prefix_length (Always null). When the address is an IPv4 address, an attribute ipv4 (integer representation of the address) is also added, when it’s an IPv6 address, an attribute hex_ipv6 (integer representation of the address in hexadecimal) is also added.

When the input is an IPv4 subnet mask, along with the above attributes, the following are also returned - ipv4_range_start (integer representation of the least IP address in the given range) , ipv4_range_end (integer representation of the highest IP address in the given range), netmask_prefix_length (length of the subnet mask). When the input is an IPv6 subnet mask, these attributes are prefixed with “hex_ipv6” instead of “ipv4” and the corresponding values are in hexadecimal.

Return type

object

Domain

This is a scalar function (calculates a single output value for a single input row.)

Categories

Usage

parse_ip( arg )

Argument

Type

Required

Multiple

arg

string

Required

Only one

Examples

make_col ip:parse_ip(@.x)

Creates a column named ‘ip’ containing the returned JSON object

Aliases

parseip (deprecated)