geoip_results_1

Super Fast GeoIP Enrichment of Logs

Last edited: September 18, 2019

A common use case for enriching logs is adding geographical information based on the IP address of some entity (e.g client IP, server IP etc). The needs for this enrichment vary from understanding traffic/response times/sales/etc patterns by geography to ensuring compliance. Cribl LogStream makes enriching data in motion trivial, in this post we’ll walk you through how you can add geoip information to your logs at microsecond latency ( ~5μs to be exact).

What you’ll need to get going:

1. Download Cribl LogStream (> 1.7.1) – (if you already haven’t)2. Download MaxMind GeoLite2, make sure to choose the MaxMind Binary format, direct link GeoLite2 City3. Untar the downloaded MaxMind database and note the path to the .mmdb file

To enrich data, first we need to have an IP address extracted – we can easily extract one by using the Regex Extract function:

geoip_regex_extract

… then we need to add and configure the GeoIp function:

geoip_geoip

The amount of information returned by GeoIp function is very rich:

geoip_results_0

We can then optionally, use Eval function to select only the information that we’re interested:

geoip_eval

… and here’s how the events look like on their way out of Cribl.

geoip_results_1

If you’ve enjoyed reading this and are looking to join a kick ass engineering team drop us a line at hello@cribl.io – we’re hiring!

Cribl, the Data Engine for IT and Security, empowers organizations to transform their data strategy. Customers use Cribl’s suite of products to collect, process, route, and analyze all IT and security data, delivering the flexibility, choice, and control required to adapt to their ever-changing needs.

We offer free training, certifications, and a free tier across our products. Our community Slack features Cribl engineers, partners, and customers who can answer your questions as you get started and continue to build and evolve. We also offer a variety of hands-on Sandboxes for those interested in how companies globally leverage our products for their data challenges.

More from the blog

get started

Choose how to get started

See

Cribl

See demos by use case, by yourself or with one of our team.

Try

Cribl

Get hands-on with a Sandbox or guided Cloud Trial.

Free

Cribl

Process up to 1TB/day, no license required.