Monitor and compare two log files in real time

Reedick, Andrew jr9445 at ATT.COM
Wed Aug 6 14:01:49 EDT 2008



> -----Original Message-----
> From: python-list-bounces+jr9445=att.com at python.org [mailto:python-
> list-bounces+jr9445=att.com at python.org] On Behalf Of m
> Sent: Wednesday, August 06, 2008 1:25 PM
> To: python-list at python.org
> Subject: Monitor and compare two log files in real time
> 
> I have a script I would like to write but I am not sure of where to
> start / approach. Perhaps someone could help direct me in the right
> direction. Any advice is appreciated.
> 
> I would like to write a python script that monitors two log files.
> If a certain string, lets say string1 shows up in logfile-A, I want to
> check if that same string shows up in log file-B within 8 minutes. If
> it does not show up within 8 minutes, send an email ( using sendmail
> or postfix).
> 
> Do you have any suggestions?
> --

Google on "python tail" to get a python implementation of the unix tail
command.  The rest should be easy. 

http://code.activestate.com/recipes/157035/



*****

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA622





More information about the Python-list mailing list