Re: Log file to sql database

From: KuroiNeko <evpopkov(at)carrier(dot)kiev(dot)ua>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Log file to sql database
Date: 2001-04-02 13:09:33
Message-ID: 3AC87A0D.nailN811TLE3@ed.ed
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Anyone care to share suggestions on getting data from a running syslog
> into
> postgresql database?

One way would be adding something like this to syslog.conf:

<facility>.<priority> |/path/to/insert/routine

However that might impose unwanted burden. Also, IIRC syslog keeps
`routine' loaded so making sure it doesn't waste precious cycles while idle
is up to you. This pipe would be always ready for reading, so select()
might fail to work as desired.
Another approach is to enhance log rotation program to add the records to
the database. Depends on log rotation program :)
YMMV, as always and good DB design for syslog is yet to be developed IMHO.
On one hand it has to be normalised enough to eliminate repetitions, on the
other hand, it needs to be simple and flexible to be able to adopt to
various not-so-standard programs that use syslog.
At least, facility, priority, timestamp, hostname and process (name and
PID) are quite common.

--

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter T Mount 2001-04-02 13:12:22 Re: [JDBC] Logging Queries
Previous Message Richard Huxton 2001-04-02 12:09:46 Re: Log file to sql database