Regular Expressions 101

Community Patterns

Jenkins build number extraction

-1

Regular Expression
PCRE (PHP <7.3)

/
\/var\/lib\/jenkins\/jobs\/[a-z|\-]*\/builds\/(?<build_number>[0-9]*)\/log
/
gm

Description

Extracts the build number from the source field in Splunk from the file path

Submitted by anonymous - 5 years ago