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

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) 003dc12a3fb3ecb3df49cd6e4928d71c012e2b86357f24cf03ca41e7f2c4945f SHA256 checksum (geolocation-lookup-for-splunk_113.tgz) 5e845923d6d1b9f75b15fa08faffddaa23bbc9829df38a2be6e3a47bc195b647 SHA256 checksum (geolocation-lookup-for-splunk_112.tgz) 3ff0e7288984099c708650b6f587d14a1757c17a88f8bfb982ea06cac9924176 SHA256 checksum (geolocation-lookup-for-splunk_111.tgz) fb8b1ddb55b8dc8929457be73edad49989b1d3c848125b7d96bf0d517c2a0e11
To install your download
For instructions specific to your download, click the Details tab after closing this window.

Flag As Inappropriate

Geolocation Lookup for Splunk

Admins: Please read about Splunk Enterprise 8.0 and the Python 2.7 end-of-life changes and impact on apps and upgradeshere.
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

194
Installs
715
Downloads
Share Subscribe LOGIN TO DOWNLOAD

Subscribe Share

AppInspect Tooling

Splunk AppInspect evaluates Splunk apps against a set of Splunk-defined criteria to assess the validity and security of an app package and components.

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 and add-ons from Splunk, our partners and our community. Find an app or add-on for most any data source and user need, or simply create your own with help from our developer portal.

Follow Us:
© 2005-2020 Splunk Inc. All rights reserved.
Splunk®, Splunk>®, Listen to Your Data®, The Engine for Machine Data®, Hunk®, Splunk Cloud™, Splunk Light™, SPL™ and Splunk MINT™ are trademarks and 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.