Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Servers > Syslog and MySQL
 Servers   Anything server related, Apache, MySQL, Samba, server security, sendmail, exim, etc

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 09-09-2004   #1 (permalink)
Just Joined!
 
Join Date: Sep 2004
Posts: 1
Send a message via ICQ to Matt1911 Send a message via MSN to Matt1911
Syslog and MySQL

Hi,

wanted to know if anyone here has experience with logging to a MySQL Database. I want the syslog daemon to sent it's output to a MySQL database instead of /var/log/messages.

- which software to use (I don't think the syslog daemon can do this default)
- how about performance

kind regards,

Matthijs
Matt1911 is offline  

Reply With Quote
Old 09-09-2004   #2 (permalink)
Linux Guru
 
Join Date: Apr 2003
Location: London, UK
Posts: 3,284
Performance will decrease, and then what happens if mysqld fails?

If you REALLY want to get syslog entries into mysql the best way todo it would be to write a script to parse the /var/log/messages file on an hourly basis and run INSERT queries for each of the entries, then clear the log file contents again.

EDIT: Alternativly write your own syslogd to listen for input on /dev/log and then write that to a mysqldb directly, or modify an existing syslogd code to do this.

Jason
jasonlambert is offline   Reply With Quote
Old 09-09-2004   #3 (permalink)
Just Joined!
 
Join Date: Jun 2004
Location: Portugal
Posts: 47
I use sqlsyslogd (http://www.frasunek.com/sources/security/sqlsyslogd/) to insert log messages in a MySQL database. There's also a PERL version in http://www.packetshack.org/index.php?page=sqlsyslogd.pl.

Basically it works like this:
  • - Create a FIFO somewhere on your file system (mkfifo).
    - Configure syslog to write the messages you want to that FIFO
    - Run a script that keeps reading the FIFO and every time something shows up, call sqlsyslogd to store it in MySQL

I have this setup in a central log server, receiving logs from about 10 machines. It seems to never miss any messages. There are no problems with performance, just with storage space. You really want to filter the kind of messages that go into MySQL, or your tables will grow very fast.
hchasqueira is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Free Network Mapping Tool for Microsoft® Office Visio® Professional 2007 Users
Don't map your network by hand – let LANsurveyor Express for Microsoft Visio Professional 2007 automatically create network diagrams for you.
subscribe
Free eBook:"Vulnerability Management for Dummies"
Get all the Facts and See How to Implement a Successful Vulnerability Management Program.
subscribe
Google vs The World: The Battle of the Message Security Vendors
With such a powerful name behind it, Google Message Security stands out in a sea of products that do exactly the same thing - or so they say.
subscribe

Safe, Secure Backup


All times are GMT. The time now is 12:12 PM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2