KBEC-00137 - Setting a Property from a value in a step log using a postp Matcher

Description

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);},
  },
);

Have more questions?

0 Comments

Please sign in to leave a comment.