Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(?<time>[^\[]+)\[(?<loglevel>[^\]]+)\]\s*request="(?<request>[[:xdigit:]]+)"\s*component="(?<component>[^"]+)"[[:punct:]]?[[:blank:]]*(?<message>.*)$
/
gm

Description

Parse the TYPO3 logfile into components, like

Sun, 28 Jun 2020 03:41:30 +0200 [WARNING] request="387b66f92c909" component="TYPO3.CMS.Frontend.Controller.TypoScriptFrontendController": $TSFE->set_no_cache() was triggered. Reason: config.no_cache is set. Caching is disabled!

If you use td-agent to push your log into Kibina, then define the following date/time pattern: %a, %d %b %Y %H:%M:%S %z

Submitted by Bodo Eichstädt - 4 years ago