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.
Splunk SPL users
In Splunk, netmask suffix extraction typically requires manual parsing or custom scripts. In APL, the ipv4_netmask_suffix
function simplifies this task by directly extracting the suffix from an IPv4 address in CIDR notation.
ANSI SQL users
In ANSI SQL, extracting the netmask suffix often involves using string functions like SUBSTRING
or CHARINDEX
. In APL, the ipv4_netmask_suffix
function provides a direct and efficient alternative.
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
.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 |
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.
Splunk SPL users
In Splunk, netmask suffix extraction typically requires manual parsing or custom scripts. In APL, the ipv4_netmask_suffix
function simplifies this task by directly extracting the suffix from an IPv4 address in CIDR notation.
ANSI SQL users
In ANSI SQL, extracting the netmask suffix often involves using string functions like SUBSTRING
or CHARINDEX
. In APL, the ipv4_netmask_suffix
function provides a direct and efficient alternative.
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
.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 |