Skip to content

Instantly share code, notes, and snippets.

@jogaco
Created November 2, 2015 12:02
Show Gist options
  • Save jogaco/8c9d3634fb8b0767e885 to your computer and use it in GitHub Desktop.
Save jogaco/8c9d3634fb8b0767e885 to your computer and use it in GitHub Desktop.
One liner for counting unique IP addresses from nginx rotating logs
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