Welcome to blooper

Blooper is squid-like creatures that are found in the ocean. It can also write squid access log into a database (I believe any sequel-support database). Should you write a squid access log into a data base, you won’t have to catch a blooper in the ocean of errors for that. I have already tamed one, and you are free to use it.

The idea is shamelessly stolen from logmysqldaemon script.

Installation

gem install (pg|mysql|oracle|sqlite|etc sequel database adapter)
gem install blooper

Squid configuration

logformat squid_log time %ts.%03tu response_time %tr src_ip %>a squid_request_status %Ss http_status_code %03>Hs reply_size %<st request_method %rm request_url %ru username %un squid_hier_code %Sh dst_ip %<a mime_type %mt
access_log daemon:{adapter:postgres,database:squid,username:squid,password:squid,host:db} squid_log
logfile_daemon /usr/local/bin/blooper
  1. The column names are dynamic, here time is a column name, %ts.%03tu is a value that will have been written into that column.

  2. The second string contains database access information, the credential depends on adapter, tested only with postgres.

  3. The third string is a full path to the executable ($ which blooper).

Database configuration

createdb squid
psql squid < pg.schema

Or use your own schema integration, just specify the proper format into the logformat variable in squid.conf.