Category Archives: Squid

Remove ip’s from squidguard file

You got an IP list

list:

172.36.2.10
172.36.2.12
172.36.2.14
172.36.2.15
172.36.2.17
172.36.2.17
172.36.2.202
172.36.2.21
172.36.2.23
172.36.2.38
172.36.2.40

Backup squidguard.conf

Execute sed with match whole word sintax to avoid problems removing aditional IP’s you don’t want to.

# for i in `cat list` ; do sed -i "/$i\b/d" squidguard.conf ; done
Advertisements

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