httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <>
Subject Logging
Date Thu, 25 May 1995 03:55:41 GMT

I am CCing this to the entire list minus the perl program.
I will place this *very* rough example of a logging daemon
in the incoming directory as access_logd. Much more can be
done with this.  Right now, it works.

------- Forwarded Message

To: Brian Behlendorf <>
Subject: Re: Logging Database
Cc: robh
In-reply-to: brian's message of Wed, 24 May 1995 20:10:53 -0700.
Fcc: outbox
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii

I am CCing this to Robh since it seems to only be the three of
us that have expressed much interest in the logging issue.

> On Fri, 19 May 1995, Randy Terbush wrote:
> > CREATE TABLE remote_host (

This schema is somewhat dated. I have learned quite a bit since
throwing it out there.  The following is the revised version
which attempts only to address the CLF.

Your comments are noted regarding the "one big table idea".  
Something tells me that is *not* the thing to do, but I cannot
back that up just yet.

The following form limits what I view as being the most commonly
requested information into the "request" table and reduces this
to 3 fields.  The INHERITS command allows you to do an INSERT
like so updating the fields of *all* tables.  It allows you
to SEARCH in smaller subsets.  I picture the $hostname field
being NULL unless you run an UPDATE on the data to resolve
and update that table.  Still, you are only manipulating that
one small table rather than one large one.

I am including the perl access_logd that I am testing with.
It is *very* rough.  I am borrowing from Roy's 'wwwstat' 
program to see what I can do with the info before storing
it in the DB.  Beware that the server hangs attempting to
open the pipe when first fired up.  I suppose we need to
change the open() paramenters to non-blocking or something.

============ pgperl Postgres insert transaction =============
   $query = "insert into request values (	$oct8,
						$bytes )";

      doPQexec( $query );

========== clf.sql =================
CREATE TABLE remotehost (
	oct8		int4,
	oct16		int4,
	oct24		int4,
	oct32		int4,
	hostname	text

	rfc931		text,
	authuser	text,
	request_type	text,
	protocol	text,
	status		int4

CREATE TABLE request (
	date		int4,
	resource	text,
	bytes		int4
) INHERITS (remotehost) (common);

------- End of Forwarded Message

View raw message