Skip to content

Instantly share code, notes, and snippets.

@jeffgeiger
Last active December 22, 2015 13:18
Show Gist options
  • Save jeffgeiger/6477926 to your computer and use it in GitHub Desktop.
Save jeffgeiger/6477926 to your computer and use it in GitHub Desktop.
Colorize columns in bro logs
#!/bin/bash
cat $1 | sed 's/#fields\t\|#types\t/#/g' | awk 'BEGIN {FS="\t"};{for(i=1;i<=NF;i++) printf("\x1b[%sm %s \x1b[0m",(i%7)+31,$i);print ""}'
@itsreallynick
Copy link

sed 's/^#[a-z]*s[^a-z]//' | awk 'BEGIN {FS="\t"};{for(i=1;i<=NF;i++) printf("\x1b[%sm %s \x1b[0m",(i%7)+31,$i);print ""}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment