piotrkowalczuk / elblog

Elastic Load Balancing access log parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Elastic Load Balancing access log parser

License:MIT License


Languages

Language:Go 100.0%