0

我尝试使用以下正则表达式:(a)?b(?(1)c|d)。这是来自http://www.regular-expressions.info/conditional.html的示例。

但我得到了错误。

/opt/logstash-1.4.2/bin/logstash -e 'input { stdin { } }  filter { grok { match => [ "message", "(a)?b(?(1)c|d)" ] } } output { stdout { codec => rubydebug }}'
+---------------------------------------------------------+
| An unexpected error occurred. This is probably a bug.   |
| You can find help with this problem in a few places:    |
|                                                         |
| * chat: #logstash IRC channel on freenode irc.          |
|     IRC via the web: http://goo.gl/TI4Ro                |
| * email: logstash-users@googlegroups.com                |
| * bug system: https://logstash.jira.com/                |
|                                                         |
+---------------------------------------------------------+
The error reported is: 
  undefined group option: /(a)?b(?(1)c|d)/
4

1 回答 1

0

Logstash 使用Oniguruma 正则表达式。他们的文档说这是“与 perl 5.8.0 相比缺少的功能”。所以不行。

于 2015-01-16T15:02:02.797 回答