DevOps / Scripts
bash
Beginner
Colorized tail Log Viewer
Follow application logs and highlight ERROR, WARN, INFO lines with ANSI colors.
bash
#!/bin/bash
tail -f ${1:-/var/log/syslog} | awk '{
if (/ERROR/) print "\033[31m" $0 "\033[0m"
else if (/WARN/) print "\033[33m" $0 "\033[0m"
else if (/INFO/) print "\033[32m" $0 "\033[0m"
else print $0
}'
Prerequisites
- tail
- awk
Pro Tips
- → Works with any log file — pass path as argument.
Commercial Licensing
Acquire a production access token or template license for enterprise deployment.
Module Info
- Language
- bash
- Level
- Beginner
- Read time
- 1 min
- Published
- Jul 2025
- License
- Commercial License
Newsletter
New modules every week, directly to your inbox.
Similar Modules
Postgres S3 Backup
Dump a Postgres database, gzip it, push to S3 with AES256 encryption.
bash
·
Intermediate
Disk Usage Alert
Send an alert when any mounted filesystem exceeds a usage threshold.
bash
·
Beginner
Docker Image Cleanup Script
Remove dangling images, stopped containers and unused volumes in one pass.
bash
·
Intermediate