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