Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Win32::EventLog GetMessage

by compucandi (Initiate)
on Apr 20, 2013 at 20:06 UTC ( #1029682=perlquestion: print w/replies, xml ) Need Help??
compucandi has asked for the wisdom of the Perl Monks concerning the following question:

I am using a script to parse Windows 2008 R2 event logs (specifically, application events). It works well...too well. I use this:

$log = new Win32::EventLog("Application") $Win32::EventLog::GetMessageText = 1;

Then, read the log:

while ($log->Read((EVENTLOG_SEQUENTIAL_READ|EVENTLOG_FORWARDS_READ), 1,$entry)){ ... print $entry->{Message}; ... }

However, I would like to pare down the information I get in the Message, perhaps just pulling back the Exception information, request information, etc... Is there a way to specify WHICH part of the message to request/display, preferably without having to parse the entire Message and pull out what I want? Thanks in advance for any tips!

Replies are listed 'Best First'.
Re: Win32::EventLog GetMessage
by Anonymous Monk on Apr 21, 2013 at 06:08 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1029682]
Approved by bulk88
[LanX]: 400 oO ... can't we speed it up???
[Discipulus]: go to sleep LanX I'll give you a phone when it will happens..

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2018-02-23 11:13 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (301 votes). Check out past polls.