question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maxmind vs Logstash's GeoIP Filter

See original GitHub issue

Summary

The Logstash GeoIP filter uses the a maxminddb-formatted database (that may or may not be provided by Maxmind) to populate a number of fields to enrich an event based on an IP address. As presently implemented in the Logstash filter, all fields need to be sub-fields of a single target (e.g, with target => client, we would have client.geo.*, client.as.*, etc.).

Motivation:

Clearly define destinations for all GeoIP Filter fields as a sub-field of a single target, so that users can enable ECS Compatibility Mode without losing metadata that they currently rely on.

Specifically, we have six fields that do not have direct analogues in ECS:

  • timezone: the IANA name of the timezone e.g., America/New_York
  • postal_code: a string postal code, length varies by country
  • continent_code: “A two character continent code like “NA” (North America) or “OC” (Oceania)”
  • organization: the name of the business or ISP associated with an address, reportedly available for ~40% of lookups.
  • isp: the name of the ISP
  • dma_code: us-only code representing Designated Market Area (~metro area)

Many of the existing ECS fields underneath geo.* are named aligning with Geo*2 like these here. I see some fields, such as timezone, being a good candidates as ECS additions, but I’m not so sure about others, such as the US-specific dma_code.

@ebeahan

Detailed Design:

  1. propose the addition of specs to ECS for
    • geo.timezone (IANA name, presently up to 30 characters, e.g., America/Argentina/Buenos_Aires),
    • geo.postal_code (freeform but relatively space limited, regulated by each country; see wikipedia),
    • geo.continent_code (docs define AF, AN, AS, EU, NA, OC, and SA)
  2. guidance for namespacing the other fields so that they are usable and unlikely to present future conflict, bearing in mind that they must be sub-fields of the singular target that is the parent of the related geo and as fields.
    • (a) under a mmdb sub-key? e.g, ${target}.mmdb.organization
      • since the mmdb being used may or may not be provided by Maxmind, I’d like to avoid explicitly using “maxmind” in the key name
      • dma_code, while provided in mmdb, is a US-only Nielsen Ratings construct and may not be adequately described with a mmdb prefix.
    • (b) some other way?

Related: https://github.com/logstash-plugins/logstash-filter-geoip/issues/163

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
nickpeihlcommented, Jan 11, 2021

Thanks for opening this issue @yaauie. Choropleth mapping in the Elastic Maps product could also benefit from some of these fields in ECS. We already support US postal codes and adding support for timezones and continents should also be possible.

cc @elastic/kibana-gis

0reactions
ebeahancommented, Jan 14, 2021

We already have a geo.continent_name; did you mean geo.continent_code?

Yes, geo.continent_code. 🤦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Geoip filter plugin | Logstash Reference [8.5] - Elastic
The GeoIP filter plugin can manage the database for users running the Logstash default distribution, or you can manage database updates on ...
Read more >
logstash: geolocation with geoip | @leandrojmp
The geoip filter has a very simple function, it queries an IP address in an internal database, identify its geolocation and returns some ......
Read more >
What is logstash geoip with creating Map? - eduCBA
logstash geoip is the plugin available as a filter plugin in logstash and ... MaxMind's GeoIP database is more accurate compared to the...
Read more >
Using Grok and Geoip filters in Logstash - Mohammed Hewedy
In this post, we will see an example of using Logstash to read input from a file and write to stdout and apply...
Read more >
Logstash and Maxmind - Not Just for GEOIP Anymore
The Logstash MaxMind filter enriches documents with GeoIP information from the open-source MaxMind database. But did you know that you can ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found