Regular Expressions 101

Community Patterns

IBM MQ Log Parser

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?ms)(?<date>[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4})\s(?<time>[0-9]{2}:[0-9]{2}:[0-9]{2})\s-\sProcess\((?<process>.*?)\)\sUser\((?<user>.*?)\)\sProgram\((?<program>.*?)\)\n\s*Host\((?<host>.*?)\)\sInstallation\((?<installation>.*?)\)\s*VRMF\((?<vrmf>.*?)\)\sQMgr\((?<qmgr>.*?)\)\s*(?<errorCode>AMQ[0-9]{4}):\s(?<errorDesc>.*?)EXPLANATION:\s*(?<explanation>.*?)ACTION:\s*(?<action>.*?)\s-{1,10}\s(?<source>.*?)\s\:\s(?<linenumber>[0-9]{0,4})\s-{50,60}
/
gm

Description

Breaks the IBM MQ Log into records.

Submitted by James Phillips - 2 years ago