Skip to content

Instantly share code, notes, and snippets.

@baldur
Created April 2, 2015 02:39
Show Gist options
  • Save baldur/e5432c2650e10c42f7d9 to your computer and use it in GitHub Desktop.
Save baldur/e5432c2650e10c42f7d9 to your computer and use it in GitHub Desktop.
quick data gathering from logs
if [ "$1" != "" ]; then
format=$1
else
format=mapbox
fi
echo "count for zoom"
cat *.log | grep -e "304\|200$" | grep "\.$format" | grep -v "_healthcheck" | awk -F"/" ' { print $(NF - 2) }' | sort | uniq -c | sort -n
echo "top paths"
cat *.log | grep -e "304\|200$" | grep "\.$format" | grep -v "_healthcheck" | awk '{ print $(NF -1) }' | sort | uniq -c | sort -n | tail -n 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment