$re = '/[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+\.[0-9]{1,3}+.*REST REQUEST(?:\n[^\S\n]*\S.*)+/m';
$str = '12:56:13.861 [http-nio-7777-exec-1] INFO dg.mpro.filter.CustomRequestLoggingFilter - REST REQUEST
NUMBERS OF REQUESTS:= [1]
METHOD:= [GET]
PARAMETERS & VALUES :=
REQUEST:= [/rest/indexv2/getMetadata]
12:56:13.861 [http-nio-7777-exec-1] INFO dg.mpro.filter.CustomRequestLoggingFilter - Response time: 1 seconds
13:14:46.049 [http-nio-7777-exec-2] INFO dg.mpro.filter.CustomRequestLoggingFilter - REST REQUEST
NUMBERS OF REQUESTS:= [2]
METHOD:= [GET]
PARAMETERS & VALUES := [pagesize:= 20][name:= Mosolv][page:= 1][tolerance:= 4]
REQUEST:= [/rest/indexv2/getProds/{{licensekey}}/{{username}}/%7B%22tolerance%22:%224%22,%22pagesize%22:%2220%22,%22name%22:%22Mosolv%22,%22page%22:%221%22%7D]
13:14:46.050 [http-nio-7777-exec-2] INFO dg.mpro.filter.CustomRequestLoggingFilter - Response time: 2 seconds
12:57:14.812 [http-nio-7777-exec-1] INFO dg.mpro.filter.CustomRequestLoggingFilter - REST REQUEST
NUMBERS OF REQUESTS:= [3]
METHOD:= [GET]
PARAMETERS & VALUES :=
REQUEST:= [/rest/indexv2/getMetadata]
12:57:14.813 [http-nio-7777-exec-1] INFO dg.mpro.filter.CustomRequestLoggingFilter - Response time: 1 seconds';
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