1826214 Members
2510 Online
109691 Solutions
New Discussion

Syslog

 
SOLVED
Go to solution
Daniel Fourie
Frequent Advisor

Syslog

I need to log all my syslog messages to a database.

Can somebody help??
Knowlage is Power
5 REPLIES 5
Karthik S S
Honored Contributor
Solution

Re: Syslog

As you must be aware that the syslog.log file is a text file and is dynamic by nature instead of loggin it again to a database you can retain snapshots of it by scheduling a to take a backup of that file at particular intervals. It also makes sense to have such cron job in place as you will losing the old syslog files after two successive reboot.

I think with oracle you can import the plain text files to the database (Using imp command). However I am not sure on how to constantly update the database with the growing syslog information.

Regards,
Karthik S S

Regards,
Karthik
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Karthik S S
Honored Contributor

Re: Syslog

Hi,

I found a Doc. which is similar to you requirement. The following link explains how to save an Apache log file in a PostgreSQL database,

http://www.linuxworld.com/site-stories/2001/0910.pglogd.html

Regards,
Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Laurent Laperrousaz
Regular Advisor

Re: Syslog

use a perl script based on the perl:multitail module which gives you means to tail a file.

You can parse any log

Then you can easily connect to your database thru the correct Perl module and insert records in a table...

That's it

Enjoy

Laurent

Massimo Bianchi
Honored Contributor

Re: Syslog

Hi,
apart from custom jobs, the syslog.log is never deleted untill reboot.

So, if you place a script rc that makes and additional copy of syslog, you can do all your processing offline.

Into which db you wuold kine to put the messages ?

HTH,
Massimo
David_246
Trusted Contributor

Re: Syslog

Hi mister matrix :)

I use logsurfer to redirect my syslog messages to, in my case, an e-mail program.
Why not redirect each new line to a database argument ?
It does require a little time.

If you really are interested in a daemon logsurfer running on your system collecting data from any logfile you specify, I am happy to help and give you the source. Please send an e-mail to me then at david.vandergeer@axa.nl

Regs David
@yourservice