Skip to content

Instantly share code, notes, and snippets.

@fedir
Created April 25, 2013 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fedir/5458356 to your computer and use it in GitHub Desktop.
Save fedir/5458356 to your computer and use it in GitHub Desktop.
Parsing access logs to find number of accesses by date, by hour and by minute # Inspired by https://twitter.com/climagic/status/327124836914712576
# Number of accesses, daily
zcat access.log.1.gz | awk {'print $4'} | cut -c2-12 | sort | uniq -c
# Number of accesses, hourly
zcat access.log.1.gz | awk {'print $4'} | cut -c2-15 | sort | uniq -c
# Number of accesses, minutely
zcat access.log.1.gz | awk {'print $4'} | cut -c2-18 | sort | uniq -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment