Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- log_format := ^([^ ]+) (-) (-) \[([^\]]+)\] "([^\"]+?)" ([0-9]+) ([^ ]+) "([^"])*" "([^"]*)"
- logParser := regexp.MustCompilePOSIX(log_format)
- log_format_get := ^(GET|HEAD|POST) (.+) (HTTP.+)$
- logParserGet := regexp.MustCompilePOSIX(log_format_get)
- ...
- analize1 := func (iline *string) {
- submatch := logParser.FindSubmatch(strings.TrimSpace(*iline))
- if (len(submatch[0])>0){
- pg := logParserGet.FindAllStringSubmatch(strings.TrimSpace(submatch[0][5]), 1)
- if (len(pg)>0){
- hash[pg[0][2]]++
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement