Skip to content

Instantly share code, notes, and snippets.

@avoronkin
Last active December 5, 2017 05:05
Show Gist options
  • Save avoronkin/529927664a861ac3a9de332ac0faf575 to your computer and use it in GitHub Desktop.
Save avoronkin/529927664a861ac3a9de332ac0faf575 to your computer and use it in GitHub Desktop.
nginx requests count
grep "05/Dec" /var/log/nginx/access.log | grep GET | cut -d[ -f2 | cut -d] -f1 | awk -F: '{print $2":00"}' | sort -n | uniq -c
grep "05/Dec/2017:07" /var/log/nginx/access.log| cut -d[ -f2 | cut -d] -f1 | awk -F: '{print $2":"$3}' | sort -nk1 -nk2 | uniq -c | awk '{ if ($1 > 10) print $0}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment