in reply to Win32::EventLog not returning all events?

Try subtracting the value from $log->GetOldest() from the value returned by $log->GetNumber() to determine how many are actually in the log.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Win32::EventLog not returning all events?
by syphon (Initiate) on Oct 12, 2011 at 02:18 UTC
    The problem isn't exactly with the GetNumber() method. That method seems to return the correct number (it returns the same number of events that I see in event viewer).

    The problem is that when I iterate over...

    while ($log->Read((EVENTLOG_SEQUENTIAL_READ|EVENTLOG_BACKWARDS_READ),1 +, my $entry))
    ...it doesn't include all events I see in EventVwr! If I makeit print out the event details, I can walk through the events and see the code showing me some events but missing others. I can't figure out why it'd be skipping them, as they don't look different to me in any way.