Skip to content

Instantly share code, notes, and snippets.

@deevis
Last active October 26, 2015 21:01
Show Gist options
  • Save deevis/61113a95429e219fd108 to your computer and use it in GitHub Desktop.
Save deevis/61113a95429e219fd108 to your computer and use it in GitHub Desktop.
Parse Vibe logs for slowest showing time to render, user, path, and time of request
zgrep "END: current_user" production.log.2.gz | sed 's/\(.*\) \[.*INFO.*current_user\[\(.*\)\] (\(.*\)) \(.*\)/\3\t\4\t\2\t\1/g' | sort -n | tail -n 20
# with process:request
grep "END: current_user" production.log | sed 's/\(.*\) \[.*INFO.*\[\(.*\)\].*current_user\[\(.*\)\] (\(.*\)) \(.*\)/\4\t\2\t\1\t\3\t\5/g' | sort -n | tail -n 100
# find with process:request, then loop back and find problems for each...
# Part 1
grep "END: current_user" production.log | sed 's/\(.*\) \[.*INFO.*\[\(.*\)\].*current_user\[\(.*\)\] (\(.*\)) \(.*\)/\4\t\2\t\1\t\3\t\5/g' | sort -n | tail -n 100 > slow_requests_10_26_2015.txt
# Part 2
for rqid in `cat slow_requests_10_26_2015.txt | sed 's/.*seconds\t\(.*\)\s.*2015.*/\1/g'`;do echo -e "API Calls for [$rqid]\n---------------------------\n"; grep $rqid production.log | grep "request to api.exigo.com" -A 1; echo -e "\n\n";done > exigo_slow_calls_report_10_26_2015.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment