Created
August 1, 2018 18:31
-
-
Save seanfrischmann/994781576e80bfb73ba9932faf032646 to your computer and use it in GitHub Desktop.
Tail your logs with color
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tail -F /path/to/logs/*.log | awk ' | |
/INFO/ {print "\033[32m" $0 "\033[39m"} | |
/DEBUG/ {print "\033[34m" $0 "\033[39m"} | |
/ERROR/ {print "\033[31m" $0 "\033[39m"} | |
$0 !~ /INFO|ERROR|DEBUG/ {print $0} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment