Goaccess: Support for GeoIP2

Created on 27 Aug 2015  路  13Comments  路  Source: allinurl/goaccess

Hi,

Now Maxmind has created a new database called GEOIP2 with more powerful and performance. The legacy one will be abandoned in future.

So it will be great to let goaccess support the legacy database but the new one too.

Regards,
Yudao

enhancement

Most helpful comment

Support for GeoIP2 has been added.

It now requires to configure goaccess as (GeoIP2):

./configure --enable-geoip=mmdb

or for legacy GeoIP

./configure --enable-geoip=legacy

Databases can be found here. And use --geoip-database /path/GeoLite2-City.mmdb to specify the database.

Please feel free to test it by building from upstream. It will be pushed out in the upcoming version.

All 13 comments

Thanks for pointing this out. Do you know if they have a C API/library to access GEOIP2?

yes : https://github.com/maxmind/libmaxminddb

Sorry to not pointing it on my first post

Awesome, I'll look into this. Thanks again!

No problem.
It will be great to not have a geoip compilation flag and read automatically form the library with the database path in the config file.
I'm using Mac OSX and homebrew and it's a pain to have recompile goaccess.
But I guess there are maybe other restrictions for that.

Will patch soon.

Would it be possible to add support for the maxmind GEOIP2 City database perhaps also, along with adding the outputted coordinates? Rather than just country information?

@overnine are the coordinates available on the free version of GeoIP2? Do you know which fields are available on the free version?

@allinurl I believe that they are indeed, it just contains much less records in the free version: https://www.maxmind.com/en/geoip-demo

Note that:

The GeoIP2 City database is a more accurate version of our free GeoLite2 City database.

Thanks for the reminder, I'll definitely check on this. However, not sure if I can squeeze this in the upcoming release that I'm working right now (v1.0), otherwise, it will probably be out after v1.0 for sure.

Any update on this @allinurl ? Using a .mmdb from GeoLite2 is giving errors.

Support for GeoIP2 has been added.

It now requires to configure goaccess as (GeoIP2):

./configure --enable-geoip=mmdb

or for legacy GeoIP

./configure --enable-geoip=legacy

Databases can be found here. And use --geoip-database /path/GeoLite2-City.mmdb to specify the database.

Please feel free to test it by building from upstream. It will be pushed out in the upcoming version.

Works great, thank you for implementing this, @allinurl.

For others: You will need libmaxminddb-dev on debian-based systems to compile.

hey guys,
I'm currently fighting this for the last couple of hours - I've been trying to run dockerized goaccess with geoip enabled, using GeoIP2 (mmdb, not legacy). I've been getting the same error in my docker container logs, regardless of whether I do this over docker-compose or docker run: Unable to open GeoIP2 database: /goaccess/geoip/GeoLite2-City.mmdb.
Worth mentioning is that the db file itself is located in a geoip volume which is attached to the container from the host, and I made sure that it is actually available inside the container, in the path specified in my goaccess conf file (with 755 permissions)
The image is the latest, and I also inspected the Dockerfile to make sure it was running configure with --enable-geoip=mmdb, and it is. Not sure if this is relevant but the server running this is an Ubuntu 4.15.0-99-generic.

Thanks for the help!
Dan

Was this page helpful?
0 / 5 - 0 ratings

Related issues

deosha picture deosha  路  3Comments

LoanDEV picture LoanDEV  路  3Comments

narayan1599 picture narayan1599  路  3Comments

konungrl picture konungrl  路  3Comments

Gill-Bates picture Gill-Bates  路  3Comments