On Mon, May 16, 2011 at 6:19 PM, J <jnr.gonza...@googlemail.com> wrote:
> cat logs/pdu_log_fe.log | awk -F\- '{print $1,$NF}' | awk -F\. '{print 
> $1,$NF}' | awk '{print $1,$4,$5}' | sort | uniq | while read service command 
> status; do echo "Service: $service, Command: $command, Status: $status, 
> Occurrences: `grep $service logs/pdu_log_fe.log | grep $command | grep 
> $status | wc -l | awk '{ print $1 }'`" >> logs/pdu_log_fe_clean.log; done

Small side point: Instead of "| sort | uniq |", you could use a Python
dictionary. That'll likely speed things up somewhat!

Chris Angelico
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to