regex - Rsyslog Template with regex won't verify
问题描述
I'm writing a simple template to pull IPs out of a log file being processed by rsyslog. I've checked the format across their documentation and run the regex through their own regex checker which it validated. But once I try to run rsyslog's validator across it, it fails with
rsyslogd: error during parsing file /etc/rsyslog.d/30-waf.conf, on or before line 6: invalid character '"' in object definition - is there an invalid escape sequence somewhere? [v8.16.0 try http://www.rsyslog.com/e/2207 ]
rsyslogd: error during parsing file /etc/rsyslog.d/30-waf.conf, on or before line 6: invalid character '0' in object definition - is there an invalid escape sequence somewhere? [v8.16.0 try http://www.rsyslog.com/e/2207 ]
rsyslogd: error during parsing file /etc/rsyslog.d/30-waf.conf, on or before line 6: invalid character '-' in object definition - is there an invalid escape sequence somewhere? [v8.16.0 try http://www.rsyslog.com/e/2207 ]
rsyslogd: error during parsing file /etc/rsyslog.d/30-waf.conf, on or before line 6: invalid character '9' in object definition - is there an invalid escape sequence somewhere? [v8.16.0 try http://www.rsyslog.com/e/2207 ]
rsyslogd: error during parsing file /etc/rsyslog.d/30-waf.conf, on or before line 6: syntax error on token ']' [v8.16.0 try http://www.rsyslog.com/e/2207 ]
Here is my .conf
file...
template(name="waftest" type="list") {<br>
property(name="msg"<br>
regex.type="ERE"<br>
regex.submatch="0"<br>
regex.expression="[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"<br>
regex.nomatchmode="BLANK"<br>
)<br>
}<p>
local1.*action(type="omfile" file="/var/log/FTD/waftest.log");waftest
It seems relatively simple and yet I must be missing something.
解决方案
推荐阅读
- r - 当一行具有特定值时,如何获取组的所有元素
- bash - 使用 Bash 测试计算机连接性
- symfony - Symfony: what does autowiring solve?
- c - 变量从函数返回中获取变量值
- node.js - 如何从静态服务器 (CDN) 提供受保护的图像
- python - 将频率表转换为 Pandas 中的原始数据
- mongodb - "unwinding": { "preserveNullAndEmptyArrays": false } 在 v3.4 聚合 $lookup 中不起作用
- python - Groupby 3列,每组只保留最小的5列
- api - 缺少 Docu-Sign Cartavi API 文档
- php - microtime() 函数是计算 CPU 在整个 php 脚本上花费的时间的可靠方法吗?