My friend Ghassan came up with this good example of how you can parse the contents of a text file (say after running a Jenkins build) and look inside the for an error so you can fail the build.


<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Default" xmlns="" ToolsVersion="4.0">

	<Target Name="Default">
	  <CallTarget Targets="CheckJmeterForFailure" />

	<Target Name="CheckJmeterForFailure">
		<Message Text="Check summary report for any failure" />
		<ReadLinesFromFile File="$(SummaryReportName)">
			<Output TaskParameter="Lines" PropertyName="SummaryReportOutput" />
		<Error Condition="$(SummaryReportOutput.Contains('Failure'))" Text="One of the JMeter tests failed" />

Basically you point to the file you want to parse, read it, and then look for the error condition. Thx Ghassan!