Re: [squid-users] Searching squid logs for pornographic sites

From: Ralf Hildebrandt <Ralf.Hildebrandt_at_charite.de>
Date: Thu, 12 Jun 2008 10:59:45 +0200

* Rob Asher <rasher_at_paragould.k12.ar.us>:
> Here's something similar to what you're already doing except comparing to a file of "badwords" to look for in the URL's and then emailing you the results.
>
> #!/bin/sh
> # filter.sh
> #
> cd /path/to/filterscript
> cat /var/log/squid/access.log | grep -if /path/to/filterscript/badwords > hits.out

Useless use of cat:
grep -if /path/to/filterscript/badwords /var/log/squid/access.log > hits.out
 
> /path/to/filterscript/wordfilter.gawk hits.out
>
> cat /path/to/filterscript/word-report | /bin/mail -s "URL Filter Report" you_at_yourdomain.com

Useless use of cat:
/bin/mail -s "URL Filter Report" you_at_yourdomain.com < /path/to/filterscript/word-report

Personally, I use "awk" to check for jpg/jpeg files exceeding a
certain size. I think the two approaches can be combined :)

-- 
Ralf Hildebrandt (i.A. des IT-Zentrums)         Ralf.Hildebrandt_at_charite.de
Charite - Universitätsmedizin Berlin            Tel.  +49 (0)30-450 570-155
Gemeinsame Einrichtung von FU- und HU-Berlin    Fax.  +49 (0)30-450 570-962
IT-Zentrum Standort CBF                 send no mail to snickebo_at_charite.de
Received on Thu Jun 12 2008 - 09:00:03 MDT

This archive was generated by hypermail 2.2.0 : Thu Jun 12 2008 - 12:00:04 MDT