Skip to content

Elastic Load Balancing access log parser

License

Notifications You must be signed in to change notification settings

Clever/elblog

 
 

Repository files navigation

elblog GoDoc

Build Status codecov

Library helps to parse ALB logs (but does not parse the classic version: ELB)

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 79.3%
  • Makefile 20.7%