title: extract rate as a percent from access log file
body: <p>I am trying to calculate the Error rate % from a PHP application for PHP metrics. I read the access.log file and got help outputting the total HTTP 200, 300, 400, 500 errors but I want to graph the error rate based on the 400 and 500 errors:</p>
  <p>awk '{print $9}' access.log | sort | uniq -c | sort -rn | awk '{total += $1; print} END {print total, &quot;Total&quot;}'</p>
  <p>above gives me break down count and total of all HTTP errors. Obviously, 200 is not an error. To get the error rate, I would have to divide total / 400+500 error count. Whats the best way to search for 400 and 500 errors and divide by the total to get % rate..</p>