Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2019-06-10 08:54
Flavor·PCRE (Legacy)

/
^(?:time=\"(?<longtime>\d{4}-\d{2}-\d{2}\D{1}\d{2}:\d{2}:\d{2}\+\d{2}:\d{2})\") (?:level=(?<level>(info|warn|error))) (?:msg=\"(?<msg>.*)\") (((?:duration=(?<duration>\d{1,9}.\d{1,9})) (?:gitaly_embedded=(?<gitaly_embedded>[^ ]+)) (?:method=(?<method>(POST|GET))))|((?:body="(?<body>.*)") (?<code>code=\d{3}) (?:method=(?<method2>(POST|GET)))|(?<command>command=".*"))|(?:key_id=key-(?<key_id>)\d{3})) (?:pid=(?<pid>\d{1,5})) (?:url=\"(((?<url>.*)\"))|(?:user="(?<user>.*)")|(?:public_key="(?<public_key>.*)"))
/
gm
Open regex in editor

Description

Gitlab log for td-agent

Submitted by anonymous