Question about logfiles in Python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Courtis Joannis

    #1

    Question about logfiles in Python

    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

    --
    Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
    GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
  • Harlin Seritt

    #2
    Re: Question about logfiles in Python

    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:


    Hope this sends you in the right direction.

    Comment

    Working...