Skip to content

Instantly share code, notes, and snippets.

@mariorz
Last active December 17, 2015 19:29
Show Gist options
  • Save mariorz/5660630 to your computer and use it in GitHub Desktop.
Save mariorz/5660630 to your computer and use it in GitHub Desktop.
store and count unique IPs in nginx logs
cat <(cat /var/log/nginx/access.log /var/log/nginx/access.log.1 | grep /apath | awk '{print $1}') ips.txt | sort | uniq > tmp.txt; mv tmp.txt ips.txt; cat ips.txt | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment