Skip to content

Instantly share code, notes, and snippets.

@davepullig
Last active October 24, 2021 13:15
Show Gist options
  • Save davepullig/4a8b4e88b2d90b179a9419294f38a7a2 to your computer and use it in GitHub Desktop.
Save davepullig/4a8b4e88b2d90b179a9419294f38a7a2 to your computer and use it in GitHub Desktop.
Get the top 50 visiting class-C networks from nginx log files.
cat access.log | cut -d "." -f 1,2,3 | sort -n -t. -k1,1 -k2,2 -k3,3 | uniq -c | sort -n -r -s | head -n 50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment