summaryrefslogtreecommitdiffstats
path: root/doc/ommysql.html
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-03-11 15:16:57 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2009-03-11 15:16:57 +0100
commit4df8bb4e6b6c8183c504fdb31d667717bf7584e5 (patch)
treea707a3ea82a3bdefd91ecea44ed7e119b43d496f /doc/ommysql.html
parentdd19c937c1bfbe16063c9d633a79810944ac7eba (diff)
parentae7a01e137f14055f9472408d0cf3ebf9893afba (diff)
downloadrsyslog-4df8bb4e6b6c8183c504fdb31d667717bf7584e5.tar.gz
rsyslog-4df8bb4e6b6c8183c504fdb31d667717bf7584e5.tar.xz
rsyslog-4df8bb4e6b6c8183c504fdb31d667717bf7584e5.zip
Merge branch 'beta'
Conflicts: doc/omrelp.html
Diffstat (limited to 'doc/ommysql.html')
-rw-r--r--doc/ommysql.html13
1 files changed, 12 insertions, 1 deletions
diff --git a/doc/ommysql.html b/doc/ommysql.html
index 7a3f5930..9b35b402 100644
--- a/doc/ommysql.html
+++ b/doc/ommysql.html
@@ -28,6 +28,17 @@ you know the server is running on a non-standard listen port.
<br><b>:ommysql:database-server,database-name,database-userid,database-password</b>
<br>All parameters should be filled in for a successful connect.
</ul>
+<p>Note rsyslog contains a canned default template to write to the MySQL
+database. It works on the MonitorWare schema. This template is:
+<p>
+<textarea rows="5" cols="80">$template tpl,"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%, '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, '%syslogtag%')",SQL
+</textarea>
+<p>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.
+<p>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.
<p><b>Sample:</b></p>
<p>The following sample writes all syslog messages to the
database "syslog_db" on mysqlsever.example.com. The server is
@@ -42,7 +53,7 @@ $ActionOmmysqlServerPort 1234 # use non-standard port
<p><font size="2">This documentation is part of the
<a href="http://www.rsyslog.com/">rsyslog</a>
project.<br>
-Copyright &copy; 2008 by <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a> and
+Copyright &copy; 2008, 2009 by <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a> and
<a href="http://www.adiscon.com/">Adiscon</a>.
Released under the GNU GPL version 3 or higher.</font></p>
</body></html>