----- Original Message -----
From: "Jesus, Jr. C. Enerio" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 30, 2003 10:56 AM
Subject: [plug] modify squid logs


> Good day, is there a way I could filter/modify squid's logs.
> Kasi I want sana some logs not to appear para the log file
> will not grow that big. Like for example logs from
>gatorcme.gator.com, i want them sana elimanated.
> How do I do it?

yes there is a way... but before i give you a trick how to do it, i would
like you to consider squid's logrotate feature first...

if you really insist the trick, then, here it goes...

this trick is about inter-process communication (IPC)... IPC because there
are two processes involved here... one process is squid who do the logging
and the other process is your program or script which filter it out your
unwanted logs... the key to this trick is FIFO file...

here is what you are going to do...

1. make a fifo file..

    eg. mkfifo -m 666 /path/fifo_access.log

    fifo file permission and ownership depends on you

2. modify "cache_access_log" parameter inside squid.conf

    eg. cache_access_log /path/fifo_access.log

3. reload squid

4. write a program (either shell script, perl, C, whatever you like) to read
that fifo_access.log file... read the incoming contents, filter it out based
on your filter list and redirect to another file (eg. /path/access.log) the
filtered one...

fooler.



--
Philippine Linux Users' Group (PLUG) Mailing List
[EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie

Reply via email to