Helping ordinary people create extraordinary websites!

Writing Syslog Messages to MySQL

By Rainer Gerhards
2005-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:

Copyright (c) 2005 Rainer Gerhards and Adiscon.


 2 Votes

You might also want to check these out:


Leave a Comment on "Writing Syslog Messages to MySQL"
You must be logged in to post a comment.

Link to This Tutorial Page!


GET OUR NEWSLETTERS