This page explains how to use the format_ipv4_mask function in APL.
format_ipv4_mask
function to format an IPv4 address and a bitmask into Classless Inter-Domain Routing (CIDR) notation. This function is useful when you need to standardize or analyze network addresses, especially in datasets that contain raw IPs or numerical IP representations. It supports both string-based and numeric IPv4 inputs and can apply an optional prefix to generate a subnet mask.
You can use format_ipv4_mask
to normalize IP addresses, extract network segments, or apply filtering or grouping logic based on subnet granularity.
Splunk SPL users
format_ipv4_mask
. To format IPv4 addresses with subnet masks, you typically use custom field extractions or external lookup tables. In contrast, APL provides a native function for this task, simplifying analysis at the network or subnet level.ANSI SQL users
Name | Type | Required | Description |
---|---|---|---|
ip | string | ✔️ | The IPv4 address in CIDR notation. You can use a string (e.g., '192.168.1.1' ) or a big-endian number. |
prefix | int | ✔️ | An integer between 0 and 32. Specifies how many leading bits to include in the mask. |
_time | subnet |
---|---|
1Jun 30, 11:11:46 | 192.168.1.0/24 |