http://www.perlmonks.org?node_id=1007701

kar_thik82 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I am developing a log parsing agent in perl to send windows Event logs to Zenoss Monitoring tool. Using Win32::EventLog i can able to get the Event messages but only one Eventype eg Application or System could able to parse at a time. Can you please help to how to open mutiple eventlogs at a time I need to get the total number of events combining all these event types. Below is my code which i tried

my @log_type =("Application", "Security", "Setup", "System", "Forwarde +d Events"); 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); print "$EventLog->Win32::EventLog::GetNumber($numevents)\n" +; }