Apache log one-liners using tail, awk, sort, etc.

Good bunch of samples with other examples found at: https://blog.nexcess.net/2011/01/21/one-liners-for-apache-log-files/ [code] # top 20 URLs from the last 5000 hits tail -5000 ./transfer.log | awk ‘{print $7}’ | sort | uniq -c | sort -rn | head -20 tail -5000 ./transfer.log | awk ‘{freq[$7]++} END {for (x in freq) {print freq[x], x}}’ | sort -rn… Continue reading Apache log one-liners using tail, awk, sort, etc.