Created
January 27, 2021 13:50
-
-
Save trolologuy/580912a437a0684a84ec44c232e5c12f to your computer and use it in GitHub Desktop.
A simple bash oneliner to parse the server's access.log file to split by http error codes and count them individually.
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
tail -n 5000 /var/log/access.log | awk '{print $9}' | sort | uniq -c | sort -nr | head -n15 | |
# Example of output: | |
# 2625 499 | |
# 1433 500 | |
# 569 200 | |
# 243 401 | |
# 108 404 | |
# 16 301 | |
# 6 302 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment