Count HTTP status codes in an nginx access log.
BeginnerProductionRapid-Fire Commands
Answer
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn
Field 9 is the status code in the default combined format.
More on Rapid-Fire Commands
Which process is listening on port 8080?BeginnerShow the top 10 memory-consuming processes.BeginnerFind files larger than 1 GiB on the root filesystem only.BeginnerShow failed systemd units.BeginnerShow the last 10 reboots and shutdowns.BeginnerShow failed SSH login attempts by source IP.Intermediate