Jenkins中的日志解析规则 [英] Log parsing rules in Jenkins

查看:382
本文介绍了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 .split("\\s", 2).

或者,您可以使用\s\b转义序列-\u0020.

As an alternative, you can use \s, \b, or an escape sequence - \u0020.

这篇关于Jenkins中的日志解析规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆