For generating apache logs used https://github.com/mingrammer/flog
flog > apache.log
For generating nginx logs used https://github.com:kscarlett/nginx-log-generator
nginx-log-generator > nginx.log
cat apache.log | grep -e "[: ]4..[: ]" | awk 'BEGIN {print "IP,REQUEST,PATH,STATUSCODE"} {print $1,$6,$7,$9}' | tr " " "," | sed 's/"//g' > apache-4xx.csv
cat apache.log | grep -e "[: ]5..[: ]" | awk 'BEGIN {print "IP,REQUEST,PATH,STATUSCODE"} {print $1,$6,$7,$9}' | tr " " "," | sed 's/"//g' > apache-5xx.csv
cat apache.log | grep -e "[: ]4..[: ]" -e "[: ]5..[: ]" | awk 'BEGIN {print "IP,REQUEST,PATH,STATUSCODE"} {print $1,$6,$7,$9}' | tr " " "," | sed 's/"//g' > apache-4xx-5xx.csv
cat nginx.log | grep -e "[: ]4..[: ]" | awk 'BEGIN {print "IP,REQUEST,PATH,STATUSCODE"} {print $1,$6,$7,$9}' | tr " " "," | sed 's/"//g' > nginx-4xx.csv
cat nginx.log | grep -e "[: ]5..[: ]" | awk 'BEGIN {print "IP,REQUEST,PATH,STATUSCODE"} {print $1,$6,$7,$9}' | tr " " "," | sed 's/"//g' > nginx-5xx.csv
cat nginx.log | grep -e "[: ]4..[: ]" -e "[: ]5..[: ]" | awk 'BEGIN {print "IP,REQUEST,PATH,STATUSCODE"} {print $1,$6,$7,$9}' | tr " " "," | sed 's/"//g' > nginx-4xx-5xx.csv
./get-count.sh