If it were me, I would probably do it this way instead: tail -f */spamdyke |\ sed -e "/^$/d" -e "/==$/d" -e "/TIMEOUT/d" -e "/ERROR/d" -e "/BLACKLIST_NAME/d" -e "/RDNS/d" -e "/RBL/d" |\ awk '{ print $6 " " $8 " " $10 " " $12 " " $14 }'
That way, there's only one copy of sed running continuously instead of 15. Using awk would also let you reorder the different fields or change the spacing between them if you want to. You could also easily modify it to produce CSV format (or whatever) as needed. -- Sam Clippinger On Dec 6, 2013, at 11:08 AM, Lutz Petersen wrote: > > > We use a Script that contains this (using QMail and Spamdyke): > > > > tail -f */spamdyke |\ > sed -u '/^$/d'|\ > sed -u '/TIMEOUT/d'|\ > sed -u '/RDNS_MISS/d'|\ > sed -u '/==$/d'|\ > sed -u '/ERROR/d'|\ > sed -u '/FILTER/d'|\ > sed -u 's/^.*\]: //'|\ > sed -u 's/from://'|\ > sed -u 's/to://'|\ > sed -u 's/origin_ip://'|\ > sed -u 's/origin_rdns: //'|\ > sed -u '/BLACKLIST_NAME/d'|\ > sed -u 's/ auth:.*$//'|\ > sed -u '/RDNS/d' |\ > sed -u '/RBL/d' > > > Even on heavy used Servers the Output gives good RealTime Information.. > > > _______________________________________________ > spamdyke-users mailing list > spamdyke-users@spamdyke.org > http://www.spamdyke.org/mailman/listinfo/spamdyke-users _______________________________________________ spamdyke-users mailing list spamdyke-users@spamdyke.org http://www.spamdyke.org/mailman/listinfo/spamdyke-users