How will I filter out only errors in Jenkins-email-ext, BUILD_LOG_REGEX? How will I filter out only errors in Jenkins-email-ext, BUILD_LOG_REGEX? jenkins jenkins

How will I filter out only errors in Jenkins-email-ext, BUILD_LOG_REGEX?


Your question is rather non-specific. As Juuso Ohtonen notes in a comment, what you do highly depends on what can be usually found in your log. Here's an example of what we use in one of our jobs, it is rather generic (if not to say minimalistic):

${BUILD_LOG_REGEX, regex="^.*?BUILD FAILED.*?$", linesBefore=0, linesAfter=10, maxMatches=5, showTruncatedLines=false, escapeHtml=true}

I would suggest the following: create a job that logs some text that contains types of errors you encounter (you may just spew some text file that you place in the job's workspace), then play with Java regex patterns - java.util.regex.Pattern - in the Plugin until you get the desired result. Make sure you send the e-mails from the job only to yourself :)

To use custom HTML - here's a quote from the Plugin's Content Token reference:

${JELLY_SCRIPT, template} - Custom message content generated from a Jelly script  template. There are two templates provided: "html" and "text". Custom Jelly templates  should be placed in $JENKINS_HOME/email-templates. When using custom templates, the  template filename without ".jelly" should be used for the "template" argument.  template - the template name. Defaults to "html".

The default template that you can use as your starting point is located in

$JENKINS_HOME/plugins/email-ext/WEB-INF/classes/hudson/plugins/emailext/templates/html.jelly