Created
March 9, 2018 09:58
-
-
Save fnzv/a575da33d0a17d5163cce3f6de888087 to your computer and use it in GitHub Desktop.
Useful commands to parse access.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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