Skip to content

Instantly share code, notes, and snippets.

@demofly
Created August 28, 2014 12:42
Show Gist options
  • Save demofly/4c97f93ea5bc952451c9 to your computer and use it in GitHub Desktop.
Save demofly/4c97f93ea5bc952451c9 to your computer and use it in GitHub Desktop.
Squid colored with readable date time tail
#!/bin/bash
color=`echo -e '\e[1;33m'`
rst=`echo -e '\e[0m'`
tail /var/log/squid/access.log -f -n999 | perl -p -e 's/^([0-9\.]*)/"[".localtime($1)."]"/e' | sed -e "s#.*_HIT/.*#${color}&${rst}#"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment