ephemeric has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; my $bytes; open(FILE, "squid.log") or die $!; while(<FILE>) { next unless m/\d+\s\d+\s\d+.\d+.\d+.\d+\s\w+\/\d+\s(\d+)\s\w+\s(.*? +)\s(?!-)\w+\s\w+\/(?!172.\d+.\d+.\d+)/; #1257981327.964 212098 172.16.32.142 TCP_MISS/200 3037 CONNECT mail +.google.com:443 rgabriel DIRECT/172.16.32.14 - $bytes += $1; } close(FILE); print "$bytes\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Squid Usage per User
by Anonymous Monk on Nov 28, 2009 at 15:48 UTC | |
|
Re: Squid Usage per User
by Anonymous Monk on Nov 28, 2009 at 17:00 UTC |