Category Archives: Squid

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}}'