Skip to content

Instantly share code, notes, and snippets.

@tsohr
Last active August 29, 2015 14:05
Show Gist options
  • Save tsohr/5d01bdd09d63da632294 to your computer and use it in GitHub Desktop.
Save tsohr/5d01bdd09d63da632294 to your computer and use it in GitHub Desktop.
#!/bin/sh
( tail -n 0 -f --follow=name --retry $* \
/var/log/audit/audit.log \
/var/log/messages \
/var/log/httpd/*log \
/var/log/tomcat/catalina.out \
/var/log/tomcat-rewrite.log \
/var/log/nginx/*log \
/var/log/firewalld \
/var/log/secure \
/var/log/cron \
/var/log/php_errors.log \
/var/log/vboxweb.log \
/var/log/fail2ban.log & \
journalctl --no-pager --follow --full & ) \
2>&1 \
| ack --ignore-case --flush --passthru --color --color-match=red "\\<denied\\>" \
| ack --ignore-case --flush --passthru --color --color-match=red "\\<error[a-z]*\\>" \
| ack --ignore-case --flush --passthru --color --color-match=yellow "\\<exception\\>" \
| ack --ignore-case --flush --passthru --color --color-match=yellow "\\<warn[a-z]*\\>" \
| ack --ignore-case --flush --passthru --color --color-match=green "\\<info\\>" \
| ack --ignore-case --flush --passthru --color --color-match=white "\\<debug\\>" \
| ack --ignore-case --flush --passthru --color --color-match=white "\\<trace\\>" \
| ack --ignore-case --flush --passthru --color --color-match=on_bright_green "==>[^<]*<==" \
| ack --ignore-case --flush --passthru --color --color-match=black "==>[^<]*<==" \
| perl -p -e '$| = 1; s/\%([A-Fa-f0-9]{2})/pack('C', hex($1))/seg' \
| perl -p -e '$| = 1; s/\\x([A-Fa-f0-9]{2})/pack('C', hex($1))/seg' \
| perl -p -e '$| = 1; s/\\([0-9]{3})/pack('C', oct("$1"))/seg'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment