Created
November 2, 2015 12:02
-
-
Save jogaco/8c9d3634fb8b0767e885 to your computer and use it in GitHub Desktop.
One liner for counting unique IP addresses from nginx rotating 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
ls -t /var/log/nginx/access.log.*.gz | xargs zcat | awk '{print $1}' | sort | uniq -c | sort -nr | head -n 100 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment