rsyslog template - parse failure in regular expression

后端 未结 1 1587
余生分开走
余生分开走 2021-01-23 04:11

I am trying to structure logs from my D-Link DAP-2310 in a rsyslog server. It has a non-standard log format and my idea is to fix that with regex in a rsyslog template. When I p

相关标签:
1条回答
  • 2021-01-23 04:46

    When you write ”\[(.+)\]--end”, \[ is expected to be a special character (like \n), while it is not. To avoid the special use of the backslash, you should escape it with another backslash. So while the real regex are \[(.+)\] and \[.+\](.+), the strings you have to use are: ”\\[(.+)\\]” and ”\\[.+\\](.+)”.

    Also, be careful about the double quotes, you probably want to ", and not .

    0 讨论(0)
提交回复
热议问题