Skip to content

Elastic Load Balancing access log parser

License

Notifications You must be signed in to change notification settings

piotrkowalczuk/elblog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elblog GoDoc

Build Status codecov

Library helps to parse ELB logs.

Elastic Load Balancing provides access logs that capture detailed information about requests sent to your load balancer. Each log contains information such as the time the request was received, the client's IP address, latencies, request paths, and server responses. You can use these access logs to analyze traffic patterns and to troubleshoot issues.

Example

package main 

import (
	"os"
	"fmt"
	
	"github.com/piotrkowalczuk/elblog"
)

func main() {
    file, err := os.Open("data.log")
    if err != nil {
        fmt.Println(err.Error())
        os.Exit(1)
    }
    dec := elblog.NewDecoder(file)
    
    if dec.More() {
        log, err := dec.Decode()
        if err != nil {
            fmt.Println(err.Error())
            os.Exit(1)
        }
        fmt.Println(log)
    }
}