Parsing Dr. Watson log files - Windows NT

This is a discussion on Parsing Dr. Watson log files - Windows NT ; Can anyone tell me the easiest way to parse a Dr. Watson log file? Thanks in advance!!...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Parsing Dr. Watson log files

  1. Parsing Dr. Watson log files

    Can anyone tell me the easiest way to parse a Dr. Watson log file?

    Thanks in advance!!

  2. Re: Parsing Dr. Watson log files

    Try using something like :-

    for /f "tokens=1,2,3,4" %i in (myfile.log) do echo %i %j %k %l>>
    parsedfile.txt

    the tokens tells the command to use the 1st, 2nd, 3rd and 4th colum the %i
    means the first collum variable is %i the myfile.txt is the name of the log
    and then we can echo which colums out that we want. In this case I have said
    colums 1,2,3,4 by echoing %i, %j %k %l

    "Bobby Crown" wrote in message
    news:33059c90.0402090909.1146c133@posting.google.c om...
    > Can anyone tell me the easiest way to parse a Dr. Watson log file?
    >
    > Thanks in advance!!




  3. Re: Parsing Dr. Watson log files

    Hello,

    I have done something like that via a shell script.
    It has been tested with English and German versions of drwtsn32.log
    in Windows NT 4.0, Windows 2000 and a little in Windows XP.

    Maybe you can use or tweak it.

    If you give me some feedback on it I would be glad.

    A.Freiberg@cenit.de


    Here is the script:
    ================================================== ===

    set -x
    awk '
    /App:/ {
    searchforstack = 0
    printf "\n%s " , $0
    pid = $0
    gsub ( /.*pid=/ , "" , pid)
    gsub ( /).*/ , "" , pid)
    #print pid
    }
    /Anwendung:/ {
    searchforstack = 0
    printf "\n%s " , $0
    pid = $0
    gsub ( /.*pid=/ , "" , pid)
    gsub ( /).*/ , "" , pid)
    #print pid
    }
    /----> Task List <----/ , / 0 _Total.exe/ {
    if ( $1 + 0 == pid + 0 ) printf "%s " , $2
    }
    /----> Taskliste <----/ , / 0 _Total.exe/ {
    if ( $1 + 0 == pid + 0 ) printf "%s " , $2
    }
    /When:/ {
    printf "%s " , $0
    }
    /Wann:/ {
    printf "%s " , $0
    }
    /FAULT ->/ {
    searchforstack = 1
    }
    /----> Stack Back Trace <----/ && searchforstack == 1 {
    #print "1" , $0
    getline
    #print "2" , $0
    getline
    #print "3" , $0
    getline
    printf "%s " , $NF
    searchforstack = 0
    }
    /FEHLER ->/ {
    searchforstack = 1
    }
    /----> Stack Back Trace <----/ && searchforstack == 1 {
    #print "1" , $0
    getline
    #print "2" , $0
    getline
    #print "3" , $0
    getline
    printf "%s " , $NF
    searchforstack = 0
    }
    ' drwtsn32.log > drwtsn32.log.Analyse.txt

    ================================================== ===

    "Top Rock" wrote in message news:<0FN_b.3228$396.2505@newsfe3-win.server.ntli.net>...
    > Try using something like :-
    >
    > for /f "tokens=1,2,3,4" %i in (myfile.log) do echo %i %j %k %l>>
    > parsedfile.txt
    >
    > the tokens tells the command to use the 1st, 2nd, 3rd and 4th colum the %i
    > means the first collum variable is %i the myfile.txt is the name of the log
    > and then we can echo which colums out that we want. In this case I have said
    > colums 1,2,3,4 by echoing %i, %j %k %l
    >
    > "Bobby Crown" wrote in message
    > news:33059c90.0402090909.1146c133@posting.google.c om...
    > > Can anyone tell me the easiest way to parse a Dr. Watson log file?
    > >
    > > Thanks in advance!!


+ Reply to Thread