Skip to content

Instantly share code, notes, and snippets.

@iolloyd
Last active August 29, 2015 14:16
Show Gist options
  • Save iolloyd/8019890bae5a1a322711 to your computer and use it in GitHub Desktop.
Save iolloyd/8019890bae5a1a322711 to your computer and use it in GitHub Desktop.
Find number of hits, size of max request and average size of requests
cat /var/log/nginx/access.log |
awk '/200/ {
sum += $10; n++; if (m < $10) m = $10
} END {
print sprintf("Entries %d, Max %dM, Ave %dM", n, m/1024, sum/n/1024);
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment