Skip to content

Instantly share code, notes, and snippets.

@emmanueltouzery
Created March 18, 2021 15:49
Show Gist options
  • Save emmanueltouzery/3f66e288c758fbe0716e40cd6462aaa7 to your computer and use it in GitHub Desktop.
Save emmanueltouzery/3f66e288c758fbe0716e40cd6462aaa7 to your computer and use it in GitHub Desktop.
smart log file filter
/^[0-9]{4}-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9]{3}/ {
if (contents !~ /(patterns|to|blacklist)/) {
printf("%s", contents)
}
contents = ""
}
{ contents = contents "\n" $0 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment