My buddy came up with this one-liner for checking the access log for the amount of data being served by a website (or multiple if their all dumping to the same log)


awk ‘{print $10,$7}’ /path/to/access_log | sort | uniq -c | sort -n | awk ‘{ this_bytes_total = $1 * $2; print ((this_bytes_total/1024)/1024) ” MiB total: ” $2 ” bytes sent ” $1 ” times for ” $3 }’ | sort -n > results.txt

Let me know what you think.

Leave a Reply