Last active
December 17, 2015 19:29
-
-
Save mariorz/5660630 to your computer and use it in GitHub Desktop.
store and count unique IPs in nginx logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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