Documentation
¶
Index ¶
- Constants
- Variables
- func NewAccessLogTableFormat() formats.Format
- type AccessLogTable
- func (c *AccessLogTable) EnrichRow(row *types.DynamicRow, sourceEnrichmentFields schema.SourceEnrichment) (*types.DynamicRow, error)
- func (c *AccessLogTable) GetDefaultFormat() formats.Format
- func (c *AccessLogTable) GetSourceMetadata() ([]*table.SourceMetadata[*types.DynamicRow], error)
- func (c *AccessLogTable) GetTableDefinition() *schema.TableSchema
- func (c *AccessLogTable) Identifier() string
- type AccessLogTableFormat
- func (a *AccessLogTableFormat) GetDescription() string
- func (a *AccessLogTableFormat) GetMapper() (mappers.Mapper[*types.DynamicRow], error)
- func (a *AccessLogTableFormat) GetName() string
- func (a *AccessLogTableFormat) GetProperties() map[string]string
- func (a *AccessLogTableFormat) GetRegex() (string, error)
- func (a *AccessLogTableFormat) Identifier() string
- func (a *AccessLogTableFormat) SetName(name string)
- func (a *AccessLogTableFormat) Validate() error
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 ¶
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 (a *AccessLogTableFormat) GetMapper() (mappers.Mapper[*types.DynamicRow], error)
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
Click to show internal directories.
Click to hide internal directories.