#!/bin/bash
# https://gist.github.com/marcanuy/a08d5f2d9c19ba621399
zcat /var/log/apache2/error.log.?.gz | sed 's^\[.*\]^^g' | sed 's^\, referer: [^\n]*^^g' | sort | uniq -c | sort -nr


syntax highlighted by Code2HTML, v. 0.9.1