Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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.

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?
[Corion]: Yay. FF now has u2f built-in (behind an about:config setting), so using an USB token to sign in actually works :)
[Corion]: So, it's not all bad with the new FF :)
[holli]: 2factor is a bit too much for me. i just use passwords like jhbn8789q27312laks dmaw98^
[moritz]: isn't there also some about:config setting to enable the old plugin API?
[Discipulus]: indeed, only the logo is nicer
[Corion]: moritz: Hmm, I doubt so, as I think they moved away from XUL and other UI stuff, which was used by most plugins I used
[Corion]: holli: I'm trying it out with Github and so far I don't dislike it. It's basically like an extra key I press to log in, which is an OK flow for Github
[Corion]: I haven't tried out recovery in case of a broken USB key though (even though I have three such U2F tokens lying around here)
[oiskuu]: randomly banging on the keyboard yields pretty poor entropy. much better to just base64 some /dev/random

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2017-11-20 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (293 votes). Check out past polls.

    Notices?