Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
(^[A-Z][0-9]{6})\s([0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{6})\s([0-9]{4})\s([a-z]*\/[a-z]*_[a-z]*.go:[0-9]*)\s\s(\[[a-z]*[0-9]*,[a-z]*=[0-9]*[0-9]\.[0-9]*\.[0-9]*\.[0-9]*:[0-9]*,[a-z]*,[a-z]*=[a-z]*\])\s([0-9])*\s([a-z]*)\s(".*?")\s(\{".*?\})\s(".*?")\s(\{\})\s([0-9]*.[0-9]*)\s([0-9*])\s([A-Z]*)\s([0-9]*)
/
gm

Description

Contains regex to parse the CockroachDB SQL audit log file

Submitted by Lesley Miller - 3 years ago