2015-01-16 103 views
0

我試圖使用follow正則表達式:(a)?b(?(1)c | d)。例如從http://www.regular-expressions.info/conditional.htmlLogstash是否支持正則表達式中的If-Then-Else條件?

但我得到錯誤。

/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: [email protected]    | 
| * bug system: https://logstash.jira.com/    | 
|               | 
+---------------------------------------------------------+ 
The error reported is: 
    undefined group option: /(a)?b(?(1)c|d)/ 

回答