goaccess icon indicating copy to clipboard operation
goaccess copied to clipboard

City not displayed in hosts list

Open bagage opened this issue 5 years ago • 2 comments

It might be related to #750, but currently I only get Country displayed for IP addresses and not City when using HTML report:

Capture d’écran de 2020-08-02 15-15-50

I am using dbip-city-lite-2020-08.mmdb datafile, and I verified that it contains cities using mmdblookup -f dbip-city-lite-2020-08.mmdb --ip 8.8.8.8 city names en (which returns Mountain View).

When using CLI, localization data is not present at all in the hostnames section:

Capture d’écran de 2020-08-02 15-17-06

Any idea? :)

bagage avatar Aug 02 '20 13:08 bagage

Had the same problem. It turns out that the city is only displayed with the Maxmind DB and not the DBIP one, even though the comments in the sample config file would suggest otherwise.

City resolution is only enabled if the DB type matches Maxmind's id string here:

https://github.com/allinurl/goaccess/blob/aa45260cfb8a776770f695da0cb560ff4079f1e4/src/geoip2.c#L93

I relaxed the check to also match the DBIP id DBIP-City-Lite, and that seems to work fine. Will submit a PR for this.

mikaraunio avatar May 14 '22 12:05 mikaraunio

Submitted PR #2318

mikaraunio avatar May 14 '22 12:05 mikaraunio