Skip to content

Instantly share code, notes, and snippets.

@CamW
Created September 26, 2015 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CamW/236c802a880b7d21da33 to your computer and use it in GitHub Desktop.
Save CamW/236c802a880b7d21da33 to your computer and use it in GitHub Desktop.
Count unique downloads nginx access log
#One liner to count the number of unique downloads by IP address of a specific file
#This is based on a default install on Centos 7, you may need to change the path to your log file.
awk '/YOUR_FILE_NAME/ {print $1}' < /var/nginx/log/access.log|sort|uniq|wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment