Skip to content

Instantly share code, notes, and snippets.

@dcode
Created July 21, 2015 15:00
Show Gist options
  • Save dcode/24445ad20ad0ebb5e2e7 to your computer and use it in GitHub Desktop.
Save dcode/24445ad20ad0ebb5e2e7 to your computer and use it in GitHub Desktop.
Examples on how to stream some logs from the 'current' directory through a filter. You could use grep or awk to filter to specific lines
# Notice tail
stdbuf -o0 tail -n+1 -F notice.log \
| stdbuf -o0 bro-cut -d ts note msg \
| awk -F'\t' '{ print "================\n" $1, $2"\n", $3 }'
# HTTP Tail
stdbuf -o0 tail -n+1 -F http.log \
| stdbuf -o0 bro-cut id.orig_h uri user_agent \
| awk -F'\t' '{ print "=================\n" $1, $2"\n", $3 }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment