This page explains how to use the parse_ipv4_mask function in APL.
The parse_ipv4_mask
function in APL converts an IPv4 address and its associated netmask into a signed 64-bit wide, long number representation in big-endian order. Use this function when you need to process or compare IPv4 addresses efficiently as numerical values, such as for IP range filtering, subnet calculations, or network analysis.
This function is particularly useful in scenarios where you need a compact and precise way to represent IP addresses and their masks for further aggregation or filtering.
If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.
Name | Type | Description |
---|---|---|
ip | string | The IPv4 address to convert to a long number. |
prefix | int | An integer from 0 to 32 representing the number of most-significant bits. |
null
if the conversion is unsuccessful.Use parse_ipv4_mask
to analyze logs and filter entries based on IP ranges.
Query
Output
_time | uri | method | masked_ip |
---|---|---|---|
2024-11-14T10:00:00 | /index.html | GET | 3,232,235,520 |