Count all http response status codes in a web application log files on linux




1- Sample Log file:

Given the log file below, we want to know all http response status code and sort them from the highest amount of response code to the lowest.

2- Use this command below to Count all http response status codes in a web application log files on linux:




awk '{print $9}' sample_log.log | sort | uniq -c | sort -rn

3- Output

Count Each unique Response Status Code from Web App log file

Learn more about http response status code here