Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Perl Script to parse Windows Event Logs

by brap (Pilgrim)
on Dec 07, 2012 at 14:19 UTC ( #1007747=note: print w/ replies, xml ) Need Help??


in reply to Perl Script to parse Windows Event Logs

Hi kar_thik82,

What about keeping a running count of each event log, and then printing the total?

my @log_type =("Application", "Security", "Setup", "System", "Forwarde +d Events"); my $total_events = 0; foreach $logs_type (@log_type) { #print "$logs_type\n"; Win32::EventLog::Open($EventLog, $logs_type,'') or die "Could not open System log:$^E\n"; $EventLog->Win32::EventLog::GetNumber($numevents); $total_events += $numevents; # print "$EventLog->Win32::EventLog::GetNumber($numevents)\n"; } print "Total number of events: $total_events\n";

Not exactly tested, but hopefully enough to illustrate the point.


Comment on Re: Perl Script to parse Windows Event Logs
Download Code
Replies are listed 'Best First'.
Re^2: Perl Script to parse Windows Event Logs
by kar_thik82 (Novice) on Dec 07, 2012 at 17:33 UTC

    Thanks Brap It works for me.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007747]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2015-07-30 01:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls