Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: grabbing time from a syslog logfile

by socketdave (Curate)
on Sep 12, 2005 at 20:18 UTC ( [id://491361]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    ( my $date ) = ( $line =~ /^(\w\w\w \d\d \d\d:\d\d:\d\d \d\d\d\d [-|\+
    +]\d\d\d\d)/ );
    
    print str2time( $date )."\n";
    
  2. or download this
    open (PIPE, "/path/to/tail -n 10 /path/to/logfile |");
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://491361]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-25 16:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found