This page explains how to use the parse_ipv4 function in APL.
The parse_ipv4
function in APL converts an IPv4 address and represents it as a long number. You can use this function to convert an IPv4 address for advanced analysis, filtering, or comparisons. It is especially useful for tasks like analyzing network traffic logs, identifying trends in IP address usage, or performing security-related queries.
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
Splunk does not provide a direct function for converting an IPv4 address into a long number. However, you can achieve similar functionality using custom SPL expressions.
ANSI SQL users
SQL does not have a built-in function equivalent to parse_ipv4
, but you can use bitwise operations to achieve a similar result.
Parameter | Type | Description |
---|---|---|
ipv4_address | string | The IPv4 address to parse into a long number. |
The function returns the IPv4 address as a long number if the conversion succeeds. If the conversion fails, the function returns null
.
You can use the parse_ipv4
function to analyze web traffic by representing IP addresses as long numbers.
Query
Output
_time | uri | method | ip_long |
---|---|---|---|
2024-11-14T10:00:00 | /index.html | GET | 3,232,235,777 |