Sometimes we need to send some excerpts from Jenkins console output (job logs) as email, such as test results, etc.
Email-ext plugin of Jenkins can do this job. Add "${BUILD_LOG_EXCERPT, start="...", end="..."} into [Post-build Actions -> Editable Email Notification -> Default Content (or Content in a specified trigger)]. the value of "start" and "end" is a regular expression and the matching lines are excluded. " BUILD_LOG_REGEX" and " BUILD_LOG_MULTILINE_REGEX" are also useful. See [Editable Email Notification -> Content Token Reference] for all available tokens.
See also: http://stackoverflow.com/questions/9439450/how-will-i-filter-out-only-errors-in-jenkins-email-ext-build-log-regex http://siddesh-bg.blogspot.com/2012/04/using-buildlogregex-in-jenkins-email.html