#!/bin/sh # This is a script to parse syslog messages from a Barracuda Spam Firewall and # extract only the error messages. # It makes several assumptions (not the least of which that your barracuda logs to /var/log/maillog), # and might need to be tweaked (or not work at all) if your syslog format differs from the one # I was using in any way. # This script lives at http://www.elifulkerson.com now=`date |awk '{printf "%s %2s", $2, $3}'` date echo echo Daily Barracuda Errorlog echo ------------------------ cat /var/log/maillog |grep "$now" |grep barracuda |grep error | awk '{print substr($0,index($0,$7),132)}' |sort |uniq -c |sort -rn echo echo This report is based on the syslog output of the Barricuda Spam Firewall.