back

MySQL Database Output Module

Module Name:    ommysql

Author: Michael Meckelein (Initial Author) / Rainer Gerhards <rgerhards@adiscon.com>

Description:

This module provides native support for logging to MySQL databases. It offers superior performance over the more generic omlibdbi module.

Action Parameters:

Legacy (pre-v6) Configuration Directives:

ommysql mostly uses the "very old style" (v0) configuration, with almost everything on the action line itself.

Note rsyslog contains a canned default template to write to the MySQL database. It works on the MonitorWare schema. This template is:

As you can see, the template is an actual SQL statement. Note the ",SQL" option: it tells the template processor that the template is used for SQL processing, thus quote characters are quoted to prevent security issues. You can not assign a template without ",SQL" to a MySQL output action.

If you would like to change fields contents or add or delete your own fields, you can simply do so by modifying the schema (if required) and creating your own custom template.

Sample:

The following sample writes all syslog messages to the database "syslog_db" on mysqlsever.example.com. The server is being accessed under the account of "user" with password "pwd".

Legacy Sample:

The same as above, but in legacy config format (pre rsyslog-v6):

[rsyslog.conf overview] [manual index] [rsyslog site]

This documentation is part of the rsyslog project.
Copyright © 2008-2012 by Rainer Gerhards and Adiscon. Released under the ASL 2.0.