ratibor78 / geostat

GeoStat, Python script for parsing Nginx and Apache logs files and getting GEO data from incoming IP's.
MIT License
69 stars 20 forks source link

little tweak to not throw an exception on RFC1918 IP address #3

Closed MatStace closed 5 years ago

MatStace commented 5 years ago

I was having some errors with my nginx logs, because I have both external and internal access, so was getting geoip2.errors.AddressNotFoundError: The address 192.168.168.1 is not in the database.

I suspect that this should probably be handled better by geoip2, but in the meantime, I made a little check to simply ignore non-public IP addresses, and thought it might be useful

ratibor78 commented 5 years ago

Thanks, @MatStace, this looks like a bug in geoip2 base :) so your help was useful.