Created
August 3, 2015 14:30
-
-
Save benkamphaus/db05b3a67ac8185ee453 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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