Jenkins中的日志解析规则 [英] Log parsing rules in Jenkins
问题描述
我正在使用Jenkins日志解析器插件来提取并显示构建日志. 规则文件如下:
I'm using Jenkins log parser plugin to extract and display the build log. The rule file looks like,
# Compiler Error
error /(?i) error:/
# Compiler Warning
warning /(?i) warning:/
一切正常,但由于某些原因,在已解析的输出控制台"末尾,我看到此消息,
Everything works fine but for some reasons, at the end of "Parsed Output Console", I see this message,
NOTE: Some bad parsing rules have been found:
Bad parsing rule: , Error:1
Bad parsing rule: , Error:1
我确定这是一个小问题,但目前无法解决. 请帮忙:)
This, I'm sure is a trivial issue but not able to figure it out at this moment. Please help :)
基于Kobi的回答,并研究了解析规则文件" ,我以这种方式解决了此问题(冒号后的单个空格).这完全按预期工作.
Based on Kobi's answer and having looked into the "Parsing rules files", I fixed it this way (a single space after colon). This worked perfectly as expected.
# Compiler Error
error /(?i)error: /
# Compiler Warning
warning /(?i)warning: /
推荐答案
Log Parser插件不支持您的模式中的空格.
The Log Parser Plugin does not support spaces in your pattern.
在他们的
They should probably have used 或者,您可以使用 As an alternative, you can use 这篇关于Jenkins中的日志解析规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!.split("\\s", 2)
.\s
,\b
或转义序列-\u0020
.\s
, \b
, or an escape sequence - \u0020
.