Skip to content

Instantly share code, notes, and snippets.

@benkamphaus
Created August 3, 2015 14:30
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 benkamphaus/db05b3a67ac8185ee453 to your computer and use it in GitHub Desktop.
Save benkamphaus/db05b3a67ac8185ee453 to your computer and use it in GitHub Desktop.
#!/bin/bash
function metric-grep () {
cat *.log | perl -n -e 'print "$1 $2\n" if /^(.*) INFO .* '"$1"' {.*?'"$2"' ([0-9]+).*?}/' | less
}
# call like:
# metric-grep :TransactionBytes :sum
# output like
# 2015-04-01 00:00:29.995 34818
# 2015-04-01 00:01:29.995 34669
# 2015-04-01 00:02:29.995 42927
# 2015-04-01 00:03:29.995 31013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment