Friday, 15 March 2013

jenkins - regex exclude hit if text contains a second string match -



jenkins - regex exclude hit if text contains a second string match -

i trying search thru log files see if warnings have appeared can warn in jenkins pipeline using jenkins plug in "text finder".

however, have case not want hits on string "crit" int logfile if string contains plms.

e.g. have next text in log file:

<crit> 23-jun-2014::10:57:13.649 upgrade committed <crit> 23-jun-2014::10:57:13.703 no registration found callpoint plmsview/get_next of type=external

i not interested in having warning sec line, have added next regex text finder in jenkins:

warn|error|<err>|/^(?=<crit>)(?=^(?:(?!plms).)*$).*$/

this should nail on crit if string not contain plms, i.e first line, not nail on either line.

i got code here: combine regexp

could please help me right this? thanks!

you should utilize this:

warn|error|<err>|<crit>(?!.*?no registration found)

change no registration found part match <crit> message want exclude.

this look matches line:

<info> user warner registered

so should consider using like:

^(warn|error|<err>|<crit>(?!.*?no registration found))

that matches if tokens @ origin of line (change tokens accordingly).

regex jenkins

No comments:

Post a Comment