Thread: SQUID Log in PostgreSQL
Dear PostgreSQL Enlightened , Is their any plugin or work around that would allow me to log Squid jobs into PostgreSQL ? -- With Best Regards, Vishal Kashyap. http://vishalkashyap.tk
On Sat, Dec 11, 2004 at 11:09:30PM +0530, Vishal Kashyap @ [SaiHertz] wrote: > Is their any plugin or work around that would allow me to log Squid > jobs into PostgreSQL ? This is more of a Squid issue than a PostgreSQL issue. I think people have proposed sending Squid logs to MySQL, so I'd suggest googling to see if any such projects have gotten anywhere. Try asking on the Squid mailing lists if you haven't already. A somewhat precarious mechanism would be to configure Squid to log to a FIFO and have a script reading the FIFO and inserting records into a database. I've done this in simple tests but I don't know if it's viable on a busy Squid server. If you want to explore this possibility, be sure to do thorough testing, especially for cases where one side or the other closes its side of the FIFO. If you can live with limited information being logged, then you could configure redirect_program to use a program that logs to a database. Look through squid.conf to see if any other directives can be (ab)used this way. If you have any C programming skills then you could hack the Squid code yourself. -- Michael Fuhr http://www.fuhr.org/~mfuhr/
On Saturday 11 December 2004 9:39 am, Vishal Kashyap @ [SaiHertz] wrote: > Dear PostgreSQL Enlightened , > > Is their any plugin or work around that would allow me to log Squid > jobs into PostgreSQL ? Assuming Squid is set up to write to syslog try the modular syslog daemon: http://sourceforge.net/projects/msyslog/ Msyslogd has various modules/filters for input to and output from syslog including an output module to write syslog info to PostgreSQL. In my case the message part of each syslog entry has a specific format so I modified the PostgreSQL module to further parse the message into appropriate columns. It's worked quite well and, like PG, has proven reliable (the connection from the msyslog daemon to PG has been up for about a year). Cheers, Steve
Thanks Steve I got the starter point. What I am trying to do is make accounting system for net usage by using the log. -- With Best Regards, Vishal Kashyap. http://vishalkashyap.tk