Skip to content

Instantly share code, notes, and snippets.

@yuanchuan
Created April 15, 2014 03:56
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 yuanchuan/10700809 to your computer and use it in GitHub Desktop.
Save yuanchuan/10700809 to your computer and use it in GitHub Desktop.
log
#/bin/sh
visit() {
awk '!/POST|scripts|images|styles|admin|logshare/ { print $1; }' $1
}
shake() {
awk '/POST/ && /shake/ { print $1; }' $1
}
count() {
wc -l | awk '{print $1}'
}
name="$(basename $1 .log)"
pv="pv[$(visit $1 | count)]"
uv="uv[$(visit $1 | sort | uniq | count)]"
code="发放[$(shake $1 | count)]"
printf "%10s %10s %10s %15s\n" $name $pv $uv $code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment