Simple nginx access log parser with AS resolving

01 Nov 2015

There are lots of different, often complex log parsers available for web servers, but I wanted something simple but specific for my low-traffic blog: how many hits did I get, from which networks. And with networks, I'm interested in the AS rather than IP addresses.

So, I whipped something up for default nginx access logs, which does just that. I've put it to run as a cron job at 0700am, shortly after logrotate created the .1 for the log. It's available as a gist.