Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.31 KB

README.md

File metadata and controls

42 lines (31 loc) · 1.31 KB

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)
    }
}