Jenkins Couples Analysis Rules

I am using the Jenkins log parser plugin to retrieve and display the assembly log. The rule file looks like this:

# Compiler Error error /(?i) error:/ # Compiler Warning warning /(?i) warning:/ 

Everything works fine, but for some reason, at the end of the 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 am sure, is a trivial problem, but unable to understand it at this moment. Please, help:)

EDIT: Based on Kobi's answer and looking at β€œParsing rule files,” I fixed it this way (one place after the colon). This worked perfectly as expected.

 # Compiler Error error /(?i)error: / # Compiler Warning warning /(?i)warning: / 
+4
source share
2 answers

Log Parser Plugin does not support spaces in your template.

This is clearly visible in the source code :

 final String ruleParts[] = parsingRule.split("\\s"); String regexp = ruleParts[1]; 

They probably should have used .split("\\s", 2) .

Alternatively, you can use \s , \b or the escape sequence - \u0020 .

+5
source

I have not tried spaces in the template, but this did not work. It turns out that the Parsing Rules rule files do not support blank lines. As soon as I deleted the blank lines, I did not get this "Bad parsing rule: error: 1".

I think since the line is empty - it does not repeat any rule after the first colon. It would be nice if the line number was indicated where the problem is.

0
source

Source: https://habr.com/ru/post/1486556/


All Articles