in reply to Win32::EventLog to CSV

k, but this is not giving me what i needed. How are you supposed to get all the values for each row in the event log.

Replies are listed 'Best First'.
Re^2: Win32::EventLog to CSV
by slloyd (Hermit) on Jun 09, 2005 at 19:20 UTC
    This should give you the value for every key in the hash.
    use Win32; use Win32::EventLog; $handle=Win32::EventLog->new("system"); $handle->GetNumber($recs); $handle->GetOldest($base); $x = 0; while ( $x < $recs ){ %Hash=(); $handle->Read(EVENTLOG_FORWARDS_READ|EVENTLOG_SEEK_READ,$base+$x,\ +%Hash); my $message=Win32::EventLog::GetMessageText(\%Hash); foreach my $key (sort(keys(%Hash))){ print "\t$key=$Hash{$key}\n"; } print "$message\n"; $x++; }