Skip to content

dsparling/go-apache-log-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-apache-log-parser

Usage

lines, err := apachelogparser.Parse("logs/access_log")
if err != nil {
	log.Fatal(err)
}
for _, line := range lines {
	fmt.Printf("remote host: %s\n", line.RemoteHost)
	fmt.Printf("time: %s\n", line.Time)
	fmt.Printf("request: %s\n", line.Request)
	fmt.Printf("status: %d\n", line.Status)
	fmt.Printf("bytes: %d\n", line.Bytes)
	fmt.Printf("referer: %s\n", line.Referer)
	fmt.Printf("user agent: %s\n", line.UserAgent)
	fmt.Printf("url: %s\n", line.Url)
}

About

Go library for parsing standard Apache log files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages