This page explains how to use the ipv4_netmask_suffix function in APL.
The ipv4_netmask_suffix
function in APL extracts the netmask suffix from an IPv4 address. The netmask suffix, also known as the subnet prefix length, specifies how many bits are used for the network portion of the address.
This function is useful for network log analysis, security auditing, and infrastructure monitoring. It helps you categorize IP addresses by their subnets, enabling you to detect patterns or anomalies in network traffic or to manage IP allocations effectively.
If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.
Parameter | Type | Description |
---|---|---|
ipv4address | string | The IPv4 address in CIDR notation (e.g., 192.168.1.1/24 ). |
24
for 192.168.1.1/24
.32
when the input IPv4 address doesn’t contain the suffix.null
if the input is not a valid IPv4 address in CIDR notation.When analyzing network traffic logs, you can extract the netmask suffix to group or filter traffic by subnets.
Query
Output
geo.country | netmask |
---|---|
USA | 24 |
UK | 24 |