pineau wrote:

>  
> 
>  
> 
> Hi again !!
> 
> I wrote a script that lists all eventlogs for Software, Security and
> System. But my final goal would be to list only those that have been
> written in the day (for today, it would be only those written on Aug
> 13th 2003). But when I read an entry, I can’t get the date of its
> creation in the hash reference. So is it possible to get it or not???

If you dump the hashref, you should get something like:

$hashRef = {
  'Message' => 'The Event log service was stopped.
',
  'Length' => 4,
  'User' => '',
  'ClosingRecordNumber' => 0,
  'EventType' => 4,
  'Timewritten' => 1060325346,
  'Computer' => 'huey',
  'Source' => 'EventLog',
  'Data' => '    ',
  'TimeGenerated' => 1060325346,
  'RecordNumber' => 7071,
  'Strings' => '',
  'EventID' => -2147477642,
  'Category' => 0
};

There are 2 times there they should cover it for you.

Untested:

my $now = time;
...
my $gentime = $hashref->{TimeGenerated};
if ($gentime >= $now - 86400) {
        # happened in last 24 hours
}


-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)


_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to