Skip to content

Instantly share code, notes, and snippets.

@pmuellr
Created March 5, 2015 15:01
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 pmuellr/5e5cc10c19b71d9599a1 to your computer and use it in GitHub Desktop.
Save pmuellr/5e5cc10c19b71d9599a1 to your computer and use it in GitHub Desktop.
cf log filters
#!/bin/sh
#-------------------------------------------------------------------------------
# customizable `cut` command for `cf log`
#-------------------------------------------------------------------------------
BLAN="-c 28"
TIME="-c 12-19"
WHOM="-c 29-40"
STDW="-c 42-44"
MESG="-c 46-"
cut $TIME $BLAN $MESG
#-------------------------------------------------------------------------------
# 1 2 3 4 5
# 12345678901234567890123456789012345678901234567890
# --------------------------------------------------------------------------
# 2015-03-05T09:20:00.17-0500 [App/0] OUT <message here>
#-------------------------------------------------------------------------------
#!/bin/sh
#-------------------------------------------------------------------------------
# remove [RTR/123] messages from `cf log`
#-------------------------------------------------------------------------------
grep --line-buffered --invert-match --fixed-strings "[RTR/"
#-------------------------------------------------------------------------------
# 1 2 3 4 5
# 12345678901234567890123456789012345678901234567890
# --------------------------------------------------------------------------
# 2015-03-05T09:20:00.17-0500 [RTR/0] OUT <message here>
#-------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment