access_log

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const AccessLogTableIdentifier = "apache_access_log"
View Source
const AccessLogTableNilValue = "-"

Variables

View Source
var AccessLogTableFormatPresets = []formats.Format{
	DefaultApacheAccessLogFormat,
	&AccessLogTableFormat{
		Name:        "common",
		Description: "Apache Common Log Format.",
		Layout:      `%h %l %u %t "%r" %>s %b`,
	},
	&AccessLogTableFormat{
		Name:        "combined",
		Description: "Apache Combined Log Format.",
		Layout:      `%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i"`,
	},
}
View Source
var DefaultApacheAccessLogFormat = &formats.Regex{
	Name:        "apache_default",
	Description: "A default regex format that covers both Apache Common and Combined log formats.",
	Layout:      `^(?P<remote_addr>[^ ]*) (?P<remote_logname>[^ ]*) (?P<remote_user>[^ ]*) \[(?P<timestamp>[^\]]*)\] "(?P<request_method>\S+)(?: +(?P<request_uri>[^ ]+))?(?: +(?P<server_protocol>\S+))?" (?P<status>[^ ]*) (?P<body_bytes_sent>[^ ]*)(?: "(?P<http_referer>(?:\\.|[^"\\])*)" "(?P<http_user_agent>(?:\\.|[^"\\])*)")?$`,
}

Functions

func NewAccessLogTableFormat

func NewAccessLogTableFormat() formats.Format

Types

type AccessLogTable

type AccessLogTable struct {
	table.CustomTableImpl
}

AccessLogTable - table for apache access logs

func (*AccessLogTable) EnrichRow

func (c *AccessLogTable) EnrichRow(row *types.DynamicRow, sourceEnrichmentFields schema.SourceEnrichment) (*types.DynamicRow, error)

func (*AccessLogTable) GetDefaultFormat

func (c *AccessLogTable) GetDefaultFormat() formats.Format

func (*AccessLogTable) GetSourceMetadata

func (c *AccessLogTable) GetSourceMetadata() ([]*table.SourceMetadata[*types.DynamicRow], error)

func (*AccessLogTable) GetTableDefinition

func (c *AccessLogTable) GetTableDefinition() *schema.TableSchema

func (*AccessLogTable) Identifier

func (c *AccessLogTable) Identifier() string

type AccessLogTableFormat

type AccessLogTableFormat struct {
	// the name of this format instance
	Name string `hcl:"name,label"`
	// Description of the format
	Description string `hcl:"description,optional"`
	// the layout of the log line
	Layout string `hcl:"layout"`
}

func (*AccessLogTableFormat) GetDescription

func (a *AccessLogTableFormat) GetDescription() string

func (*AccessLogTableFormat) GetMapper

func (*AccessLogTableFormat) GetName

func (a *AccessLogTableFormat) GetName() string

GetName returns the format instance name

func (*AccessLogTableFormat) GetProperties

func (a *AccessLogTableFormat) GetProperties() map[string]string

func (*AccessLogTableFormat) GetRegex

func (a *AccessLogTableFormat) GetRegex() (string, error)

GetRegex converts the layout to a regex

func (*AccessLogTableFormat) Identifier

func (a *AccessLogTableFormat) Identifier() string

Identifier returns the format TYPE

func (*AccessLogTableFormat) SetName

func (a *AccessLogTableFormat) SetName(name string)

SetName sets the name of this format instance

func (*AccessLogTableFormat) Validate

func (a *AccessLogTableFormat) Validate() error

Jump to

Keyboard shortcuts

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