<?xml version="1.0" encoding="windows-1252"?>
<node id="1007701" title="Perl Script to parse Windows Event Logs" created="2012-12-07 04:43:53" updated="2012-12-07 04:43:53">
<type id="115">
perlquestion</type>
<author id="1007699">
kar_thik82</author>
<data>
<field name="doctext">
Hi Monks,
&lt;p&gt;
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
&lt;/p&gt; 

&lt;code&gt;
my @log_type =("Application", "Security", "Setup", "System", "Forwarded 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-&gt;Win32::EventLog::GetNumber($numevents);
		   print "$EventLog-&gt;Win32::EventLog::GetNumber($numevents)\n";
		  
		}
&lt;/code&gt;</field>
</data>
</node>
