Skip to content

Instantly share code, notes, and snippets.

@danhyun
Created January 31, 2013 19:24
Show Gist options
  • Save danhyun/4685613 to your computer and use it in GitHub Desktop.
Save danhyun/4685613 to your computer and use it in GitHub Desktop.
Someone asked me to get a count per day breakdown of page loads for a particular page
$ grep "GET /foo/bar.html" access_log | awk '{print $4}' | cut -d: -f1 | uniq -c
281 [27/Jan/2013
288 [28/Jan/2013
40 [29/Jan/2013
38 [30/Jan/2013
20 [31/Jan/2013
$ grep "POST /foo/doBar.html" access_log | awk '{print $4}' | cut -d: -f1 | uniq -c
160 [27/Jan/2013
150 [28/Jan/2013
14 [29/Jan/2013
17 [30/Jan/2013
5 [31/Jan/2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment