国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

linux - rsyslog 配置mysql輸出格式
ringa_lee
ringa_lee 2017-04-17 13:29:10
0
1
397

http://www.rsyslog.com/doc/v8-stable/configuration/modules/ommysql.html
文檔中:
Note rsyslog contains a canned default template to write to the MySQL database. It works on the MonitorWare schema. This template is:

$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
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.

請(qǐng)問如何修改template或者自定義template呢?

ringa_lee
ringa_lee

ringa_lee

reply all(1)
阿神

已解決。定義template:
$template tpl,"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%FROMHOST-IP%', %syslogpriority%, '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, '%syslogtag%')",SQL
設(shè)置ommysql后面直接加上 ";tpl" #template name

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template