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.

请问如何修改template或者自定义template呢?

已解决。定义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

设置ommysql后面直接加上 “;tpl” #template name

mysql设置输出格式_rsyslog 配置mysql输出格式相关推荐

  1. windows设置mysql使用率_Windows下配置Mysql

    这里说的配置Mysql,是在安装时进行的,请先查看:Windows平台下安装Mysql 紧接上文,安装完成后将配置选项打上对勾,按下"Finish",出现下面的界面,这里有一个很好 ...

  2. linux下mysql设置关联_Linux下mysql安装与配置

    1.安装 epel 源 [root@qfedu.com~]#yum-yinstallepel-release.noarch 2.安装 MySQL Repository [root@qfedu..com ...

  3. mysql服务器管理员_配置MySQL服务器时,需要设置一个管理员账号,其名称是( )。...

    配置MySQL服务器时,需要设置一个管理员账号,其名称是( ). 答:root 当访问无效的数组下标时,会发生 答:抛出异常 频率特性 G(jω) 的曲线关于复数平面的实轴对称. 答:对 董先生提到, ...

  4. mysql部署window设置分片_window配置 mysql 详细步骤

    1.配置环境变量:右击"我的电脑"-->"高级"-->"环境变量" 3)在(系统变量)path变量(已存在不用新建)添加变量值: ...

  5. homebrew mysql conf_homebrew 安装mysql后,如何配置mysql

    这个是我最新并且一直推崇的方法: 1.安装:sunyichaodeMacBook-Pro:~ sunyichao$ brew install mysql 2.开启mysql:mysql.server ...

  6. mysql 设置双1_2020-10-15:mysql的双1设置是什么?

    福哥答案2020-10-15:#福大大架构师每日一题# 其实就是innodb_flush_log_at_trx_commit和sync_binlog两个参数设置,都设置为1就是双1设置.MySQL 默 ...

  7. myeclipse2014 mysql连接池_myeclips配置mysql连接池

    http://gstarwd.iteye.com/blog/542845 第一: 首先声明,这些配置过程只适合Tomcat6.0,因为Tomcat6.0以下的版本,配置过程有那么一点不一样!Tomca ...

  8. python安装mysql数据库教程,Python配置mysql的教程(必看)

    下面小编就为大家带来一篇Python配置mysql的教程(推荐).小编觉得挺不错的,现在就分享给大家,也给大家做个参考.一起跟随小编过来看看吧 Linux系统自带Python,且根据系统自带资源来对p ...

  9. mysql -- MAC下安装配置mysql

    1:进入官网,链接是 https://dev.mysql.com/downloads/mysql/ 点击第一个dmg文件,download 2:点击 No thanks, just start my ...

最新文章

  1. 用Scrum敏捷开发工具Leangoo做Sprint迭代管理
  2. 【Android 热修复】热修复原理 ( 热修复框架简介 | 将 Java 字节码文件打包到 Dex 文件 )
  3. 利用多项式特征生成与递归特征消除解决特征组合与特征选择问题
  4. 【收藏备用】服务器基本故障及排查方法
  5. CodeForces - 375D Tree and Queries(树上启发式合并)
  6. VS2013 MFC基于对话框编程(创建工程)
  7. hibernate jpa_JPA /Hibernate刷新策略初学者指南
  8. 电商页面设计需要的素材模板|好的模板就是好的参考
  9. 强悍的 Vim —— .vimrc(vim 配置文件)
  10. caffe︱Places365-CNNs For Scene Recognition
  11. insert into select from要注意什么_老外说put two and two together什么意思?是2+2?
  12. 汉字在字库中的偏移地址计算
  13. 银河麒麟服务器v10 sp2安装fio磁盘IO检测工具
  14. 管理理念:导致员工工作效率低下的8大原因
  15. 巨佬Jake Wharton曾说过:一个App只需要一个Activity
  16. 未来架构:从服务化到云原生
  17. 批量打印--不展现直接后台打印
  18. Python学习八:pip 最常用命令、pip升级、pip 清华大学开源软件镜像站、Python日期和时间(Time模块、日历(Calendar)模块)
  19. visual studio创立上位机软件(C#)(定时器)
  20. Xshell国内免费下载

热门文章

  1. FreeBSD学习笔记15-FreeBSD下安装Apache
  2. java 删除二维数组中的null_避免在Java中检查Null语句
  3. markdown文件转word文件
  4. Hive 导入CSV文件
  5. python抓包代码_Python抓包并解析json爬虫的完整实例代码
  6. 逻辑回归算法_算法逻辑回归
  7. Java 调用 Python 方法学习笔记
  8. [转载] java-继承和多态
  9. 如何设置单词第一个字母大写_大写一行中每个单词的第一个和最后一个字母
  10. mysql5批处理_转关于mysql5.5 的批处理讨论(转载)