Regular Expressions 101

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?P<error_date>^[\w\/\.]+)\s+(?P<error_time>[\w\/\.\:]+)\s+\*(?P<error_level>\w+)\*\s+\[((?P<error_ip>[\d\.]+)\s+\[(?P<error_thread_id>.+)\]\s+(?P<error_request_method>\w+)\s+(?P<error_urlpath>.+)\s+(?P<error_req_protocol>.+)|(?P<error_thread>.+?))\]\s+(?P<error_message>.+[\n]?.+)
/
gm

Description

AEM - Author & Publisher - error.log - RegEx for SPLUNK fields

Submitted by Robert Wunsch (wunsch@adobe.com) - 2 years ago