icon/x Created with Sketch.

Splunk Cookie Policy

We use our own and third-party cookies to provide you with a great online experience. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. Some cookies may continue to collect information after you have left our website. Learn more (including how to update your settings) here.
Accept Cookie Policy

We are working on something new...

A Fresh New Splunkbase
We are designing a New Splunkbase to improve search and discoverability of apps. Check out our new and improved features like Categories and Collections. New Splunkbase is currently in preview mode, as it is under active development. We welcome you to navigate New Splunkbase and give us feedback.

Accept License Agreements

This app is provided by a third party and your right to use the app is in accordance with the license provided by that third-party licensor. Splunk is not responsible for any third-party apps and does not provide any warranty or support. If you have any questions, complaints or claims with respect to this app, please contact the licensor directly.

Thank You

Downloading GeoASN
SHA256 checksum (geoasn_13.tgz) d311d2103fdca609798108233e104a5d833c00b9e8551c49caa39ec3277af9d1 SHA256 checksum (geoasn_12.tgz) 6bedce5f20b6106bc13cabe129691b86a828a3ee92c77f9c67ce86f02cad9d14 SHA256 checksum (geoasn_11.tgz) 764dda0072948d49f2302e0aed3e1e90e1f9ad5df308ae68fba71eae5470386c SHA256 checksum (geoasn_10.tgz) 3554b63bead0edb62c239423a0d0160128071c55dcd0028355ccac5ea81206b9
To install your download
For instructions specific to your download, click the Details tab after closing this window.

Flag As Inappropriate

splunk

GeoASN

This app has been archived. Learn more about app archiving.
This app is NOT supported by Splunk. Please read about what that means for you here.
Overview
Details
Very fast lookups of the Country, Organization and ASN to which an IP address belong.

Four GeoIP lookup commands are provided

lookup geo
inputs: clientip
outputs: client_country client_region client_city client_lat client_lon

lookup asn
inputs: src_ip dest_ip
outputs: src_asn dest_asn

lookup geoasn
inputs: src_ip dest_ip
outputs: src_country dest_country src_asn src_as src_org dest_asn dest_as dest_org

lookup ga
inputs: ip
ouputs: country asn org

Background

This app includes GeoLite data created by MaxMind, available from http://www.maxmind.com/

The Add-On is based on Will Hayes @ Splunk's MAXMIND Geo Location Lookup Script, but it has been rewritten to use the native Maxmind C libraries, for increased speed and functionality. GeoASN requires that you build the Maxmind C SDK and Python SDK, and copy the resulting libraries to $SPLUNK_HOME (see detailed instructions in the README file).

The GeoASN lookup commands scales better, and can thus be used from within props.conf to provide automatic Country, Organization and ASN information for any search where an IP address is encountered.

Example Searches

If you have logs with a single IP address field:

  • | lookup ga ip
  • | lookup ga ip AS the_name_of_your_ip_addr_field

If you have logs with two IP address fields:

  • | lookup geoasn src_ip dest_ip
  • | lookup geoasn src_ip AS your_1st_field dest_ip AS your_2nd_field

Example props.conf

If you always want your searches to lookup the Country, Organization and ASN for IP addresses, you can configure props.conf to do this:

LOOKUP-geoasn = geoasn src_ip dest_ip

We typically use this for sourcetypes that have field extractions for src_ip and dest_ip, e.g., firewall logs.

It produces the following fields:

  • src_country : The Country as found in the Maxmind GeoCity database
  • dest_country : The Country as found in the Maxmind GeoCity database
  • src_asn : The AS number and Org as found in the Maxmind ASN database
  • src_as : The AS number, without the 'AS' prefix
  • src_org : The Organization, without the AS number
  • dest_asn : The AS number and Org as found in the Maxmind ASN database
  • dest_as : The AS number, without the 'AS' prefix
  • dest_org : The Organization, without the AS number

If the IP address being looked up is within the ranges defined in RFC 1918 (Private IP addresses), the Country and Organization is set to 'RFC1918', to make it easy to filter on Private IP addresses. AS number is set to 0.

If the address was not found in the database, and it is not an RFC 1918 address, the Country and Organization is set to 'Unknown', and the AS number is set to 0.

Performance

Benchmarking from Maxmind has shown that the native C libraries are capable of doing 400.000 IP address lookups per second, when memory caching is not used. The C implementation is capable of more than 1 million lookups/s when memory caching is used. GeoASN uses both the native C libraries and memory caching for maximum performance.

Another optimization is the lookup of the Country, Organization and ASN for both the src_ip and dest_ip in one single command. Instead of executing multiple lookup commands, we only execute once.

Typical Use Cases

All logs containing IP addresses will be easier to analyze if you, for each IP address, can tell which Country and Organization it belongs to. This is especially relevant for security analysis, where one can perform queries and reports to e.g., show all foreign communications.

Enjoy!

Henrik Strom
Telenor Norway

Release Notes

Version 1.3
April 19, 2011

Updated GeoIP database. Minor config file changes.

Version 1.2
April 6, 2011

Code optimization. Wrong placement of re.compile in geo.py. Fixed now.

Version 1.1
April 5, 2011

Added proper RFC 1918 checking to all four lookups.
Requested by Thomas Petersen, who also supplied the RFC 1918 regex now used in the code.

Version 1.0
April 4, 2011

Subscribe Share

Are you a developer?

As a Splunkbase app developer, you will have access to all Splunk development resources and receive a 10GB license to build an app that will help solve use cases for customers all over the world. Splunkbase has 1000+ apps from Splunk, our partners and our community. Find an app for most any data source and user need, or simply create your own with help from our developer portal.

Follow Us:
Splunk, Splunk>,Turn Data Into Doing, Data-to-Everything, and D2E are trademarks or registered trademarks of Splunk Inc. in the United States and other countries. All other brand names,product names,or trademarks belong to their respective owners.