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 Geolocation Lookup for Splunk
SHA256 checksum (geolocation-lookup-for-splunk_114.tgz) 5e5ead8fd0a258d9fc7fb0b86d3ad4ed86d30c218264a5dc244ea65a1fc20376 SHA256 checksum (geolocation-lookup-for-splunk_113.tgz) de60f50e50fe2c45de1d6655f7cbbb1cdc9c28bad622a627322bf4a1308f6a27 SHA256 checksum (geolocation-lookup-for-splunk_112.tgz) f0fccf319ee1a821c4e4fc3fd150899d9f16f38b57e6c18703f63faf25aaffca SHA256 checksum (geolocation-lookup-for-splunk_111.tgz) 235cb7512800acdac17d41ea0ee62c48b7fd64bf995b571d1076de713e946296
To install your download
For instructions specific to your download, click the Details tab after closing this window.

Flag As Inappropriate

splunk

Geolocation Lookup for Splunk

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
This app adds an external lookup command that allows the user to convert a given City/Region/Country into a latitude/longitude. This is primarily useful for converting asset information that contains text locations into a lat/long value for Enterprise Security.

Change Log

1.0

  • Initial internal release

1.1

  • Cleanup for public release, documentation, bug fixing

1.1.1

  • Disabled inputs by default

1.1.2

  • Tested compat with 7.2
  • Added readme note that the command must be run with "local=true"

1.1.3

  • Tested compatibility with 7.3
  • Minor code change for future py3 compatibility
  • Updated included external library text files

1.1.4

  • Fixed a space/tab issue
  • Confirmed compatibility with 8.0 / py3

Prerequisites

This search command is packaged with the following external libraries:
+ GeoNames city database: http://download.geonames.org/export/dump/cities1000.zip
+ GeoNames Admin Code database: http://download.geonames.org/export/dump/admin1CodesASCII.txt
+ GeoNames Country database: http://download.geonames.org/export/dump/countryInfo.txt

The city list is maintained via a scripted input that uses the following OS utilities:
+ rm
+ wget
+ unzip
+ cat
+ cut
+ echo
+ date
+ grep

Known Issues

  • The lookup is inefficient so results are produced slowly. This is because of the looping used to try and find a matching city to produce a lat/long. It may change in the future but it's not a show stopping issue.

Installation

Follow standard Splunk installation procedures to install this app.

Reference: https://docs.splunk.com/Documentation/AddOns/released/Overview/Singleserverinstall
Reference: https://docs.splunk.com/Documentation/AddOns/released/Overview/Distributedinstall

Scripted Inputs for Updating Libraries

There are two scripted inputs: * updatecountry.sh * updatecities.sh

These are written for Linux systems and are disabled by default. The expected libraries are included with this app and this is only important if you want to maintain updated versions of the external databases.

Description

The purpose of this app is to provide an external lookup method for converting city information into the nearest known lat/long combination primarily for the generation of identity and asset information for Splunk Enterprise Security.

How it works

  1. Determine if a lat/lon are provided OR if a city/country/region was provided
  2. If the user provides a lat/lon, we try to return a city/region/country
  3. If a city/country/region is provided, we try to return the lat/lon

  4. If a city/country was provided,

  5. Normalize the country provided to an ISO code, if possible (i.e. United States should be US)
  6. Check to see if a region value was provided and try to normalize it as well (i.e. Colorado should be CO.)
  7. Note: if a region is not provided, a partial match using just the City and Country is attempted.

  8. Do the lookup

  9. When doing a conversion from lat/lon to City/Region/Country - the lookup parses all cities in the list in an attempt to find the closest match based on distance between the provided lat/lon and the database lat/lon
  10. When performing a city/region/country lookup, a simple text match is performed.

Region Normalization

This app leverages the admin codes database (http://download.geonames.org/export/dump/admin1CodesASCII.txt) for region normalization. When the lookup is initialized a dictionary is created converting entries in this database from: * CA.08 Ontario Ontario 6093943
To: * [CA.08] = Ontario

When a region is provided during the lookup, the app attempts to find the first matching value and return the key. If a key is found, then we use the region portion (i.e. 08) as the region for our lookup:
region = matched_key[len(result[args.country])+1::]

The result is the ability to match database entries formated like this: * Amherstburg 42.11679 -83.04985 CA 08 America/Toronto

(City / Lat / Lon / Country Code / Region Code / Timezone)

Usage

Command Type

  • External Lookup

Command Usage

The external lookup cannot be distributed at this time. Ensure the lookup command is set to "local=true".

| lookup local=true geolocate city,region,country OUTPUT lat,lon

Additionally, the lookup can output the matched time zone:

| lookup local=true geolocate city,region,country OUTPUT lat,lon,timezone

Support

If support is required or you would like to contribute to this project, please reference: https://gitlab.com/johnfromthefuture/TA-geolocate. This app is supported by the developer as time allows.

Release Notes

Version 1.1.4
Jan. 17, 2020

1.1.4
Confirmed compatibility with Splunk 8 / py3.

Version 1.1.3
Aug. 1, 2019

1.1.3

  • Tested compatibility with 7.3
  • Minor code change for future py3 compatibility
  • Updated included external library text files
Version 1.1.2
Oct. 22, 2018

1.1.2

  • Tested compat with 7.2
  • Added readme note that the command must be run with "local=true"
Version 1.1.1
July 25, 2018

Disabled inputs by default as it was expected per app documentation


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.