From 2d22c1324d3559880485e9583aab7d2a78bfe7a1 Mon Sep 17 00:00:00 2001 From: nekrassov01 Date: Thu, 14 Mar 2024 13:30:22 +0900 Subject: [PATCH] chore: update regex patterns --- parser_regex.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/parser_regex.go b/parser_regex.go index df0cad2..909c513 100644 --- a/parser_regex.go +++ b/parser_regex.go @@ -108,10 +108,10 @@ func NewApacheCLFRegexParser(ctx context.Context, writer io.Writer, opt Option) decoder: regexLineDecoder, opt: opt, patterns: []*regexp.Regexp{ - regexp.MustCompile(`^(?P\S+) (?P\S+) (?P[\S ]+) (?P\[[^\]]+\]) \"(?P[A-Z]+) (?P[^ \"]+) (?PHTTP/[0-9.]+)\" (?P[0-9]{3}) (?P[0-9]+|-) "(?P[^\"]*)" "(?P[^\"]*)"`), - regexp.MustCompile(`^(?P\S+) (?P\S+) (?P[\S ]+) (?P\[[^\]]+\]) \"(?P[A-Z]+) (?P[^ \"]+) (?PHTTP/[0-9.]+)\" (?P[0-9]{3}) (?P[0-9]+|-)`), - regexp.MustCompile(`^(?P\S+)\t(?P\S+)\t(?P[\S ]+)\t(?P\[[^\]]+\])\t\"(?P[A-Z]+) (?P[^ \"]+) (?PHTTP/[0-9.]+)\"\t(?P[0-9]{3})\t(?P[0-9]+|-)\t"(?P[^\"]*)"\t"(?P[^\"]*)"`), - regexp.MustCompile(`^(?P\S+)\t(?P\S+)\t(?P[\S ]+)\t(?P\[[^\]]+\])\t\"(?P[A-Z]+) (?P[^ \"]+) (?PHTTP/[0-9.]+)\"\t(?P[0-9]{3})\t(?P[0-9]+|-)`), + regexp.MustCompile(`^(?P\S+) (?P\S+) (?P[\S ]+) (?P\[[^\]]+\]) \"(?P[A-Z\-]+) (?P[^ \"]+) (?PHTTP/[0-9.]+|-)\" (?P[0-9]{3}) (?P[0-9]+|-) "(?P[^\"]*)" "(?P[^\"]*)"`), + regexp.MustCompile(`^(?P\S+) (?P\S+) (?P[\S ]+) (?P\[[^\]]+\]) \"(?P[A-Z\-]+) (?P[^ \"]+) (?PHTTP/[0-9.]+|-)\" (?P[0-9]{3}) (?P[0-9]+|-)`), + regexp.MustCompile(`^(?P\S+)\t(?P\S+)\t(?P[\S ]+)\t(?P\[[^\]]+\])\t\"(?P[A-Z\-]+) (?P[^ \"]+) (?PHTTP/[0-9.]+|-)\"\t(?P[0-9]{3})\t(?P[0-9]+|-)\t"(?P[^\"]*)"\t"(?P[^\"]*)"`), + regexp.MustCompile(`^(?P\S+)\t(?P\S+)\t(?P[\S ]+)\t(?P\[[^\]]+\])\t\"(?P[A-Z\-]+) (?P[^ \"]+) (?PHTTP/[0-9.]+|-)\"\t(?P[0-9]{3})\t(?P[0-9]+|-)`), }, } if opt.LineHandler == nil { @@ -129,10 +129,10 @@ func NewApacheCLFWithVHostRegexParser(ctx context.Context, writer io.Writer, opt decoder: regexLineDecoder, opt: opt, patterns: []*regexp.Regexp{ - regexp.MustCompile(`^(?P\S+) (?P\S+) (?P\S+) (?P[\S ]+) (?P\[[^\]]+\]) \"(?P[A-Z]+) (?P[^ \"]+) (?PHTTP/[0-9.]+)\" (?P[0-9]{3}) (?P[0-9]+|-) "(?P[^\"]*)" "(?P[^\"]*)"`), - regexp.MustCompile(`^(?P\S+) (?P\S+) (?P\S+) (?P[\S ]+) (?P\[[^\]]+\]) \"(?P[A-Z]+) (?P[^ \"]+) (?PHTTP/[0-9.]+)\" (?P[0-9]{3}) (?P[0-9]+|-)`), - regexp.MustCompile(`^(?P\S+)\t(?P\S+)\t(?P\S+)\t(?P[\S ]+)\t(?P\[[^\]]+\])\t\"(?P[A-Z]+) (?P[^ \"]+) (?PHTTP/[0-9.]+)\"\t(?P[0-9]{3})\t(?P[0-9]+|-)\t"(?P[^\"]*)"\t"(?P[^\"]*)"`), - regexp.MustCompile(`^(?P\S+)\t(?P\S+)\t(?P\S+)\t(?P[\S ]+)\t(?P\[[^\]]+\])\t\"(?P[A-Z]+) (?P[^ \"]+) (?PHTTP/[0-9.]+)\"\t(?P[0-9]{3})\t(?P[0-9]+|-)`), + regexp.MustCompile(`^(?P\S+) (?P\S+) (?P\S+) (?P[\S ]+) (?P\[[^\]]+\]) \"(?P[A-Z\-]+) (?P[^ \"]+) (?PHTTP/[0-9.]+|-)\" (?P[0-9]{3}) (?P[0-9]+|-) "(?P[^\"]*)" "(?P[^\"]*)"`), + regexp.MustCompile(`^(?P\S+) (?P\S+) (?P\S+) (?P[\S ]+) (?P\[[^\]]+\]) \"(?P[A-Z\-]+) (?P[^ \"]+) (?PHTTP/[0-9.]+|-)\" (?P[0-9]{3}) (?P[0-9]+|-)`), + regexp.MustCompile(`^(?P\S+)\t(?P\S+)\t(?P\S+)\t(?P[\S ]+)\t(?P\[[^\]]+\])\t\"(?P[A-Z\-]+) (?P[^ \"]+) (?PHTTP/[0-9.]+|-)\"\t(?P[0-9]{3})\t(?P[0-9]+|-)\t"(?P[^\"]*)"\t"(?P[^\"]*)"`), + regexp.MustCompile(`^(?P\S+)\t(?P\S+)\t(?P\S+)\t(?P[\S ]+)\t(?P\[[^\]]+\])\t\"(?P[A-Z\-]+) (?P[^ \"]+) (?PHTTP/[0-9.]+|-)\"\t(?P[0-9]{3})\t(?P[0-9]+|-)`), }, } if opt.LineHandler == nil { @@ -150,11 +150,11 @@ func NewS3RegexParser(ctx context.Context, writer io.Writer, opt Option) *RegexP decoder: regexLineDecoder, opt: opt, patterns: []*regexp.Regexp{ - regexp.MustCompile(`^(?P[!-~]+) (?P[!-~]+) (?P