Created
January 27, 2021 13:51
-
-
Save trolologuy/4b5aa77887ad0960254f43212fc7cad6 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. By default it browses `/var/log/access.log` and limit's the search on the last `5000` lines.
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