Question about logfiles in Python

C

Courtis Joannis

Hello readers,

my name is Joannis Courtis and I study computer science in
Frankfurt/Germany. I hope you can help me, because I try to find a script
that helps me to filter logfiles which I received from the Microsoft
Exchange Server.
Can you help me, where I can find a script in Python.

Regards Joannis Courtis
 
H

Harlin Seritt

I'm not familiar with Exchange log files but this can be done rather
easily assuming the log file is a flat text file (which usually these
are not-- like NT event logs).

search_str = "words and phrases"
data = open(LogFile, 'r').read()

if search_str in data:
flag = 1

If they are binary files, you may have to use a special module (or
write one yourself if it doesn't exist). A good place to look is in
Mark Hammond's Win32 modules. You'll find some stuff here:
http://starship.python.net/crew/mhammond/

Hope this sends you in the right direction.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top