Skip to content

Instantly share code, notes, and snippets.

@vxf
Last active December 21, 2015 21:18
Show Gist options
  • Save vxf/6366907 to your computer and use it in GitHub Desktop.
Save vxf/6366907 to your computer and use it in GitHub Desktop.
# total apache hits by vhost on a log
cat other_vhosts_access.log | awk '{ print $1 }' | sort | uniq -c | sort -nr
# total apache hits by day on a log
cat other_vhosts_access.log | awk '{ print substr($5, 2, 11) }' | uniq -c
# total apache hits by month on every other_vhosts_access.log*
zcat other_vhosts_access.log.*.gz | cat - other_vhosts_access.log other_vhosts_access.log.1 | awk '{ print substr($5, 5, 8) }' | sort | uniq -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment