Skip to content

Instantly share code, notes, and snippets.

@ept
Last active May 11, 2016 20:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ept/04126c677d872603cc3b to your computer and use it in GitHub Desktop.
Save ept/04126c677d872603cc3b to your computer and use it in GitHub Desktop.
awk '{print $7}' access.log | # Split by whitespace, 7th field is request path
sort | # Make occurrences of the same URL appear consecutively in file
uniq -c | # Replace consecutive occurrences of the same URL with a count
sort -rn | # Sort by number of occurrences, descending
head -n 5 # Output top 5 URLs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment