Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Golang

`
^(?P<RuleNumber>[\d]+)\s+(?P<Chain>[^\s]+):\s+in:(?P<InputInterface>[^,]+)\s+out:(?P<OutputInterface>[^,]+),\s+(?:src-mac\s+(?P<SourceMacAddress>[^,]+),\s+)?proto\s+(?P<Protocol>\w+)(?:\s+\((?P<Flags>[^)]+)\))?,\s+\[?(?P<SourceAddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[a-f\d:]+)\]?(?::(?P<SourcePort>\d+))?->\[?(?P<DestinationAddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[a-f\d:]+)\]?(?::(?P<DestinationPort>\d+))?,\s+len\s+(?P<Length>\d+)$
`
gm

Description

Used with Azure Log Analytics

Submitted by anonymous - 5 years ago