$re = '/(?s)(?:threadId:)(?<threadId4>.*?)(?:\s*\|)(?:.*userId:)(?<userId4>.*?)(?:\s*\|)(?:.*applicationName:)(?<appName>.*?)(?:\s*\|)(?:.*payload:)(?<payload>.*?)(?:\s*\|)/m';
$str = '[INFO] 28 Jun 2018 14:02:29,480 SYSLOG->|datetime:20180628140229479+0000|hostname:marketingprofile-deployment-877c7f857-cv9d6/10.44.0.15(10.44.0.15)|threadId:47-http-nio-11551-exec-1(main)|userId:null|correlationId:c7943b58-a584-4cba-ad44-45cf1af3a400|applicationName:RETRIEVEMARKETINGPROFILE-V1|direction:ENTERING|operationName:RetrievalService|className:LogServletFilter|methodName:logRequest|clusterName:TXH|webServiceType:REST|payload:<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--<INPUTINFO> <BBCAN>8881008923</BBCAN> </INPUTINFO>--><INPUTINFO> <APPLICATIONID>NCOG</APPLICATIONID> <CLINETREQUESTID>test</CLINETREQUESTID> <VISION> <CUSTOMERID>151862438</CUSTOMERID> <ACCOUNTID>0001</ACCOUNTID> </VISION> <!--<VOICECAN>0178430862672</VOICECAN>--> <!-- <BBCAN>060002792607</BBCAN> --> <!--<BTN>2016221232</BTN> --> <!-- <ADDRESS> <ADDRESSID>030862772</ADDRESSID> <STATE>MD</STATE> </ADDRESS> --> <!--<SSPBAN>0178430862772</SSPBAN>--> <!--<PCAN>E100007652</PCAN> --> </INPUTINFO>|requestVerb:POST|httpHeaders:content-length={534};ssp-correlationid={c7943b58-a584-4cba-ad44-45cf1af3a400};host={10.44.0.15:11551};content-type={text/xml};connection={Keep-Alive};accept-encoding={gzip};user-agent={Apache-HttpClient/4.1.1 (java 1.5)};|requestUrl:http://10.44.0.15:11551/retrieveMarketingProfile/RetrievalService?null';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php