This page explains how to use the geo_info_from_ip_address function in APL.
The geo_info_from_ip_address function in APL retrieves geographic information based on an IP address. It maps an IP address to attributes such as city, region, and country, allowing you to perform location-based analytics on your datasets. This function is particularly useful for analyzing web logs, security events, and telemetry data to uncover geographic trends or detect anomalies based on location.
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, the equivalent process often involves using lookup tables or add-ons to resolve IP addresses into geographic details. In APL, geo_info_from_ip_address performs the resolution natively within the query, streamlining the workflow.
Copy
Ask AI
| eval geo_info = iplocation(client_ip)
ANSI SQL users
In SQL, geographic information retrieval typically requires a separate database or API integration. In APL, the geo_info_from_ip_address function directly provides geographic details, simplifying the query process.
Copy
Ask AI
SELECT ip_to_location(client_ip) AS geo_infoFROM sample_http_logs
['sample-http-logs']| extend ip_location = geo_info_from_ip_address('20.53.203.50')| where ip_location.country == "Australia" and ip_location.country_iso == "AU" and ip_location.state == "New South Wales"