Optimizing the performance of track_msg

Posted: September 3rd, 2012 | Author: | Tags: , , | No Comments »

I had initially written track_msg using python’s re module, but after some tests on fairly large logs (~250Mb) I realized that using inline functions like python’s string module was much more efficient the script ran reasonably fast on larger files.

I think there’s still room for improvements but I’m going to move on for now, and see if there are any bugs that I’ll run into during daily use.

The latest release is available here

An attempt at searching postfix logs

Posted: August 2nd, 2012 | Author: | Tags: , , | No Comments »

A while back I had to do a lot of searching through postfix log files at work. I got tired of having to first, find the original email based on the to and from information, then searching the logs using the various queue id’s as the emails got queued by the mail daemon.

So, I wrote a python script that combined the process and it did the job and saved me a good amount of time. I then got carried away and added color to the output, and got a bit fancy. So I decided to make the script public. It is still not optimal and processing large files ( > 2Gb ) takes longer than I’d like. Hopefully in future iterations I’ll improve the performance.

More info is available on the track_msg page.