Calculate navigation size SQUID logs

IP’s used by administrator user

user = administrator

(xzcat *access*.xz; zcat *access*.gz) | grep administrator | awk '{if(data[$3]==0)ips[++cnt]=$3; data[$3]+=$5}END{for(i=1;i<=cnt;i++){print ips[i]" "data[ips[i]]/1048576}}'

IP’s used by impresora user without DENY

(xzcat *access*.xz; zcat *access*.gz) | grep -v TCP_DENIED | awk '$8 ~ /impresora/ {if(data[$3]==0)ips[++cnt]=$3; data[$3]+=$5}END{for(i=1;i<=cnt;i++){print ips[i]" "data[ips[i]]/1048576}}'
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s