#!/usr/bin/perl -- use strict; use warnings; use Regexp::Log::Common; my $rlog = Regexp::Log::Common->new(); $rlog->capture(qw' remotehost bytes '); my $rlogre = $rlog->regexp; my %remotes; { use autodie qw' open close '; open my($file), '<', "squid.log"; while(<$file>){ if(/$rlogre/){ $remotes{$1} += $2; } } close $file; } for(sort keys %remotes){ printf "%10d %s\n", $remotes{$_}, $_; }
In reply to Re: Squid Usage per User
by Anonymous Monk
in thread Squid Usage per User
by ephemeric
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |