Skip to content

Instantly share code, notes, and snippets.

@deevis
Created February 19, 2015 22:53
Show Gist options
  • Save deevis/580ffc503d4bf7dc8182 to your computer and use it in GitHub Desktop.
Save deevis/580ffc503d4bf7dc8182 to your computer and use it in GitHub Desktop.
Count requests by hour from NGINX logfile from a particular IP address
for h in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24;do echo ""; echo "19/Feb/$h:00"; echo "----------------------"; grep "199.102.210.214 - - \[19\/Feb\/2015\:$h" /var/log/nginx/access.log.1 | wc -l ;done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment