Skip to content

Instantly share code, notes, and snippets.

@fnzv
Created March 9, 2018 09:58
Show Gist options
  • Save fnzv/a575da33d0a17d5163cce3f6de888087 to your computer and use it in GitHub Desktop.
Save fnzv/a575da33d0a17d5163cce3f6de888087 to your computer and use it in GitHub Desktop.
Useful commands to parse access.log
# Sort access by Response Codes
awk -F\" '{print $2}' access.log | awk '{print $2}' | sort | uniq -c | sort -r
# Combined
awk '{print $9}' access.log | sort | uniq -c | sort
Example:
4 405
19 503
564 500
1013 103
1479 206
1541 403
2137 401
4914 404
10167 301
17121 304
43591 302
998653 200
# Most 404 Errors
grep "HTTP/1.1\" 404" access_log | awk '{print $7 } ' | sort | uniq -c | sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment