Hits per second, hits per minute

In case you need to generate file from a log with the number of hits per second or minute you can use the fallowing commands-

Hits per second –

cat access.log | cut -d[ -f2 | cut -d] -f1 | awk 'BEGIN { FS=":" } ; { print $1":"$2":"$3":"$4 }'| sort | uniq -c >/home/user/hits-per-sec

Hits per minute –

cat access.log | cut -d[ -f2 | cut -d] -f1 | awk 'BEGIN { FS=":" } ; { print $1":"$2":"$3 }' | sort | uniq -c >/home/user/hits-per-min