title: Jenkins pipeline: fail build on string found in build console
body: <p>Using jenkins pipeline, I want to fail build when a word (for example, "FATAL") is found in build log.</p>
  
  <p>There is a <a href="https://plugins.jenkins.io/text-finder" rel="nofollow noreferrer">Text Finder</a> plugin that can do it in freestyle jobs, but one cannot use it in pipelines.</p>