Writing Syslog Messages to MySQL
By Rainer Gerhards2005-08-04
Conclusion
With minumal effort, you can use rsyslogd to write syslog messages to a MySQL database. Once the messages are arrived there, you can interactivley review and analyse them. In practice, the messages are also stored in text files for longer-term archival and the databases are cleared out after some time (to avoid becoming too slow). If you expect an extremely high syslog message volume, storing it in real-time to the database may outperform your database server. In such cases, either filter out some messages or think about alternate approaches involving non-real-time database writing (beyond the scope of this paper).
The method outline in this paper provides an easy to setup and maintain solution for most use cases, especially with low and medium syslog message volume (or fast database servers).
I have set up a site to demo web access to syslog data. It is build using the steps outlined here and uses phpLogCon as the front-end. You might want to visit it to get a glimpse of how such a beast might look.
Tutorial Pages:
» Abstract
» Background
» Overall System Setup
» Setting up the system
» On Reliability...
» Conclusion
» Feedback Requested
Copyright (c) 2005 Rainer Gerhards and Adiscon.
