|
|
|
@ -73,7 +73,8 @@ func TestCorrectLines(t *testing.T) {
|
|
|
|
|
t.Fatalf("Parsing of empty line failed %v %v", err, event)
|
|
|
|
|
}
|
|
|
|
|
fmt.Println("event is", event)
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
csvParser.Initialize(" \t", true, []string{"\"\"", "[]"}, "ignore ignore ignore proxy ignore domain clientip ignore ignore apache-date request status bytes duration referer user-agent", "ignore")
|
|
|
|
|
line = "Aug 7 00:00:00 proxy-4 haproxy[17429]: www.yvelines.gouv.fr 66.249.64.10 - - [06/Aug/2024:23:59:59 +0200] \"GET /content/download/19274/117923/file/SE_EAU_20190325_LesJardines_78201900027_LetNotifCompletude+recepisse.pdf HTTP/1.1\" 301 1414 240 \"\" \"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.182 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\" \"-\" \"GB\" 15169"
|
|
|
|
|
fmt.Println("parsing:", line)
|
|
|
|
|
event, err = csvParser.Parse(line)
|
|
|
|
@ -82,6 +83,7 @@ func TestCorrectLines(t *testing.T) {
|
|
|
|
|
}
|
|
|
|
|
fmt.Println("event is", event)
|
|
|
|
|
|
|
|
|
|
csvParser.Initialize(" \t", true, []string{"\"\"", "[]"}, "ignore ignore ignore proxy ignore domain clientip ignore ignore apache-date request status bytes duration referer user-agent", "ignore")
|
|
|
|
|
line = "Aug 7 00:00:00 proxy-4 haproxy[17429]: www.yvelines.gouv.fr 66.249.64.10 - - [06/Aug/2024:23:59:59 +0200] \"GET /content/download/19274/117923/file/SE_EAU_20190325_LesJardines_78201900027_LetNotifCompletude+recepisse.pdf HTTP/1.1\" 301 1414 240 \"\" \"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.182 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\" \"-\" \"GB\" \"15169"
|
|
|
|
|
fmt.Println("parsing:", line)
|
|
|
|
|
event, err = csvParser.Parse(line)
|
|
|
|
@ -90,4 +92,32 @@ func TestCorrectLines(t *testing.T) {
|
|
|
|
|
}
|
|
|
|
|
fmt.Println("event is", event)
|
|
|
|
|
|
|
|
|
|
csvParser.Initialize(" ", true, []string{"\"\""}, "verb uri http-version", "ignore")
|
|
|
|
|
line = "GET /Actions-de-l-Etat/Vos-aides/Particuliers/Pass-culture?_escaped_fragment_=/particuliers/page/R65575 HTTP/1.1"
|
|
|
|
|
fmt.Println("parsing:", line)
|
|
|
|
|
event, err = csvParser.Parse(line)
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatalf("Parsing of empty line failed %v %v", err, event)
|
|
|
|
|
}
|
|
|
|
|
fmt.Println("event is", event)
|
|
|
|
|
*/
|
|
|
|
|
csvParser.Initialize(" ", true, []string{"\"\""}, "verb uri http-version", "ignore")
|
|
|
|
|
line = "GET /Actions-de-l-Etat/Vos-aides/Particuliers/Pass-culture?_escaped_fragment_=/particuliers/page/R65575 HTTP/1.1"
|
|
|
|
|
fmt.Println("parsing:", line)
|
|
|
|
|
event, err = csvParser.Parse(line)
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatalf("Parsing of empty line failed %v %v", err, event)
|
|
|
|
|
}
|
|
|
|
|
fmt.Println("event is", event)
|
|
|
|
|
|
|
|
|
|
csvParser.Initialize(" ", true, []string{"\"\""}, "verb uri http-version", "ignore")
|
|
|
|
|
line = "G"
|
|
|
|
|
fmt.Println("parsing:", line)
|
|
|
|
|
event, err = csvParser.Parse(line)
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatalf("Parsing of empty line failed %v %v", err, event)
|
|
|
|
|
}
|
|
|
|
|
fmt.Println("event is", event)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|