clf

package
v0.0.0-...-11a54c6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package clf generates Common Log Format (clf) log messages.

Configuration:

combined: (bool, optional) If true, generate Combined Log Format records,
          which add referer and user-agent fields.

- generator:
    type: clf
    combined: true

Index

Constants

View Source
const (
	// Name is the name used in the configuration file and the registry.
	Name = "clf"
)

Variables

This section is empty.

Functions

func New

func New(cfg *ucfg.Config) (generator.Generator, error)

New is the factory for Common Log Format objects.

Types

type Generator

type Generator struct {
	Record Record
	// contains filtered or unexported fields
}

Generator provides a Common Log Format record generator.

func (*Generator) Next

func (g *Generator) Next() ([]byte, error)

Next produces the next Common Log Format record.

Example:

127.0.0.1 - - [10/Oct/2000:13:55:36 -0700] "GET /random-100.html HTTP/1.0" 200 2326

type Record

type Record struct {
	Host      net.IP
	Ident     string
	AuthUser  string
	Date      string
	Request   string
	Status    string
	Bytes     string
	Referer   string
	UserAgent string
}

Record holds the random fields for a Common Log Format record.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL