Grep-By-Country
Once I had suspicion, that webserver was returning some weird responses. Like cutting them in the middle. I found out by randomly checking IP that many request come from Finland and Sweden. To be sure, I translated all IP in error log and created statistics based on country of origin. That cleared the suspicion, that problem is somewhere between USA and Scandinavia.
You will need MaxMind's GeoIP database, Perl and Geo::IP module from CPAN.
wget "http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz" -O - | gzip -d > GeoIP.dat
Examples
This will print only addresses Slovak and France.
./gbc.pl error.log --filter FR --filter SK --incl
Print without private (and unknown) addresses.
./gbc.pl error.log --filter __ --excl
Print gzipped logs and replace addresses to human readable form and exclude private (and unknown) and US addresses.
zcat error*log*gz | ./gbc.pl --replace --filter __ --filter US --excl | less
For more, check the code.
