title: How to add conditional if in Jenkins file for output with many lines
body: <p>How to add if condition, that if i get specific output do this else do this, knowing that im getting output like this </p>
  
  <pre><code>[Appium] Welcome to Appium v1.17.0
  [Appium] Non-default server args:
  [Appium]   logFile: /var/log/appium.log
  [Appium]   allowInsecure: {
  [Appium]     0: chromedriver_autodownload
  [Appium]   }
  [Appium] Appium REST http interface listener started on 0.0.0.0:4723
  </code></pre>
  
  <p>i have used this but achive nothing </p>
  
  <pre><code>script{
              def appiumLog =   sh label: 'Appium log', returnStdout: true, script: "docker logs ${containerName}"
              if( appiumLog.substring(appiumLog.lastIndexOf("\n")) == '[Appium] Appium REST http interface listener started on 0.0.0.0:4723') {
                       sh label: 'APK Loading', script: "docker cp src/main/resources/test.apk ${containerName}:/opt"
                       echo "APK file has copied to: ${containerName}"
              }  else {
                       echo "This is the output: ${appiumLog}"
                  }
           }
  </code></pre>
  
  <p>also used this but no use</p>
  
  <pre><code>            if( appiumLog.indexOf('[Appium] Appium REST http interface listener started on 0.0.0.0:4723') &gt;= 0) {
  </code></pre>