[Gllug] Sum trouble

Richard Jones rich at annexia.org
Tue Apr 8 09:49:36 UTC 2003


On Tue, Apr 08, 2003 at 10:12:04AM +0100, Leigh Mason wrote:
> Good morning all
> 
> I am trying to calculate the total sum of bytes listed in the apache 
> access_log.
> I have retrieved the particular column which gives me a list of byte 
> values thus:
> cut -f10 -d" " access_log
> 
> I can't seem to find any text type utility that will sum these values.
> What would be the usual procedure to achieve this?

The problem you'll have with all the methods suggested below is
that they'll overflow at 2 or 4 GiB. (I assume you have a fair-
sized amount of data being transferred?)

AFAIK you're stuck with writing a C program using 'long long' or
using a language with bignum support.

Rich.

-- 
Richard Jones, Red Hat Inc. (London office, UK) http://www.redhat.com/
http://www.annexia.org/ Freshmeat projects: http://freshmeat.net/users/rwmj
NET::FTPSERVER is a full-featured, secure, configurable, database-backed
FTP server written in Perl: http://www.annexia.org/freeware/netftpserver/

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list