Skip to content

Instantly share code, notes, and snippets.

@hackruu
Forked from demofly/squid-tail.sh
Created August 28, 2014 12:43
Show Gist options
  • Save hackruu/c7a12faa2f1f6af5437d to your computer and use it in GitHub Desktop.
Save hackruu/c7a12faa2f1f6af5437d to your computer and use it in GitHub Desktop.
#!/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