Skip to main content

No project description provided

Project description

MMDB

Create a MaxMind Databases for your own needs.

pip install mmdb[cli]

Features

  • Query any maxmind database: mmdb get <IP> -d <DATABASE>
  • Download and build DBIP database ASN Lite, Country Lite, and City Lite: mmdb dbip-build
  • Create an IP database from a CSV file: mmdb build <CSV>
  • Logstash GeoIP Filter Plugin compatibility: mmdb build <CSV> --lsc
  • Additional country data such as is_eu, is_nato, or is_g7: mmdb build <CSV> -f country

Examples

Example Localnet Example Country

Logstash Compatibility

Logstash ships with the GeoIP Filter Plugin which enriches a document with IP GeoData. However, the plugin supports specific MaxMind database types only. As a result, any other database type disables the plugin.

Regarding this, the plag --lsc enables logstash support. Long story short: You get a MaxMind ASN Database, but the IP info as an embedded json string within the asn_organization_name field. The logstash pipeline must load that json data and adds it to the document, exemplified below

filter {
  geoip {
    source => "ip"
    database => "/path/to/my/database.mmdb"
    ecs_compatibility => disabled
    target => "wrapped_ip_data"
  }
  json {
    source => "[wrapped_ip_data][organization_name]"
    target => "myip"
  }
  mutate {
    remove_field => ["wrapped_ip_data"]
  }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mmdb-0.1.0.tar.gz (21.1 kB view hashes)

Uploaded Source

Built Distribution

mmdb-0.1.0-py3-none-any.whl (21.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page