This tool colorizes the output based on regular expressions, making it easier to follow logs at a glance.
- go 1.16
git clone https://github.com/haroflow/logh
cd logh
go build cli/logh.go
# Copy logh to a folder in your PATH
Pass data to logh
via stdin.
Pass regular expressions as arguments to highlight the text. Each argument will get a different color (up to 10 at the moment).
Examples:
# View help
logh
# Highlights "GET" with red, "POST" with green
tail -f /var/log/httpd/access.log | logh GET POST
# Highlights the whole line containing "word"
cat textfile.txt | logh '.*word.*'
# Ignore case. Matches get, GET, Get, etc.
cat textfile.txt | logh -i get