Description

Article ID:360033193751
1 minute readKnowledge base
On this page

An example of a postp matcher that searches for a value in the step log and sets a job-step property to that value.
For example, in the output log there is something like "Build ID = 2342" and you want to create a property BuildID whose value is 2342

Solution

 push (@::gMatchers,
  {
   id =>        "BuildID",
   pattern =>   q{Build ID = (\d+)},
   action =>    q{incValue("buildId",$1);},
  },
 {
   id =>        "Compression",
   pattern =>   q{before compression: (\d+)  after compression: (\d+)},
   action =>    q{incValue("sizeBefore",$1);incValue("sizeAfter",$2);},
  },
);
This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.