[ale] Help Processing a Log File

Geoffrey esoteric at 3times25.net
Wed May 12 21:43:57 EDT 2004


Jonathan Glass wrote:
> Except that it only reads the last entry.  The other 40000+ are being
> skipped.  :(

If you do this?

#!/usr/bin/perl


use strict;

my ($user, $p1, $p2);

while (<ARGV>) {

     /jobstart/ &&  ($user = substr((split(/\'/, $_))[3], 2));
     /filestart/ &&  ($p1 = substr((split(/\'/, $_))[3], 2));
     /fileend/ && ($p2 = substr((split(/\'/, $_))[7], 2))
         && print "$user ", $p2 - $p1, "\n";
};

-- 
Until later, Geoffrey                     Registered Linux User #108567
Building secure systems in spite of Microsoft



More information about the Ale mailing list