Documentation ¶
Index ¶
Constants ¶
const PantherPrefix = "GitLab"
PantherPrefix is the prefix of all logs parsed by this package
const TypeAPI = PantherPrefix + ".API"
TypeAPI is the type of the GitLabAPI log record
const TypeAudit = PantherPrefix + ".Audit"
TypeAudit is the log type of Audit log records
const TypeExceptions = PantherPrefix + ".Exceptions"
TypeExceptions is the log type of Exceptions log records
const TypeGit = PantherPrefix + ".Git"
TypeGit is the log type of Git log records
const TypeIntegrations = PantherPrefix + ".Integrations"
TypeIntegrations is the log type of GitLabIntegrations
const TypeRails = PantherPrefix + ".Rails"
TypeRails is the type of the GitLabRails log record
Variables ¶
var APIDesc = `GitLab log for API requests received from GitLab
Reference: https://docs.gitlab.com/ee/administration/logs.html#api_jsonlog`
APIDesc describes the GitLabAPI log record
var AuditDesc = `` /* 141-byte string literal not displayed */
AuditDesc describes the Git log record
var ExceptionsDesc = `` /* 146-byte string literal not displayed */
ExceptionsDesc describes the Git log record
var GitDesc = `` /* 154-byte string literal not displayed */
GitDesc describes the Git log record
var IntegrationsDesc = `` /* 182-byte string literal not displayed */
IntegrationsDesc describes the GitLabIntegrations log record
var RailsDesc = `` /* 143-byte string literal not displayed */
RailsDesc describes the GitLabRails log record
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { Time *timestamp.RFC3339 `json:"time" validate:"required" description:"The request timestamp"` Severity *string `json:"severity" validate:"required" description:"The log level"` Duration *float32 `json:"duration" validate:"required" description:"The time spent serving the request (in milliseconds)"` DB *float32 `json:"db,omitempty" description:"The time spent quering the database (in milliseconds)"` View *float32 `json:"view,omitempty" description:"The time spent rendering the view for the Rails controller (in milliseconds)"` Status *int `json:"status" validate:"required" description:"The HTTP response status code"` Method *string `json:"method" validate:"required" description:"The HTTP method of the request"` Path *string `json:"path" validate:"required" description:"The URL path for the request"` Params []QueryParam `json:"params,omitempty" description:"The URL query parameters"` Host *string `json:"host" validate:"required" description:"Hostname serving the request"` UserAgent *string `json:"ua,omitempty" description:"User-Agent HTTP header"` Route *string `json:"route" validate:"required" description:"Rails route for the API endpoint"` RemoteIP *string `json:"remote_ip,omitempty" description:"The remote IP address of the HTTP request"` UserID *int64 `json:"user_id,omitempty" description:"The user id of the request"` UserName *string `json:"username,omitempty" description:"The username of the request"` GitalyCalls *int `json:"gitaly_calls,omitempty" description:"Total number of calls made to Gitaly"` GitalyDuration *float32 `json:"gitaly_duration,omitempty" description:"Total time taken by Gitaly calls"` QueueDuration *float32 `json:"queue_duration,omitempty" description:"Total time that the request was queued inside GitLab Workhorse"` parsers.PantherLog }
API is a a GitLab log line from an internal API endpoint TODO: Check more samples from [Lograge](https://github.com/roidrage/lograge/) JSON output to find missing fields nolint: lll
type APIParser ¶
type APIParser struct{}
APIParser parses gitlab rails logs
type Audit ¶
type Audit struct { Severity *string `json:"severity" validate:"required" description:"The log level"` Time *timestamp.RFC3339 `json:"time" validate:"required" description:"The event timestamp"` AuthorID *int64 `json:"author_id" validate:"required" description:"User id that made the change"` EntityID *int64 `json:"entity_id" validate:"required" description:"Id of the entity that was modified"` EntityType *string `json:"entity_type" validate:"required" description:"Type of the modified entity"` Change *string `json:"change" validate:"required" description:"Type of change to the settings"` From *string `json:"from" validate:"required" description:"Old setting value"` To *string `json:"to" validate:"required" description:"New setting value"` AuthorName *string `json:"author_name" validate:"required" description:"Name of the user that made the change"` TargetID *int64 `json:"target_id" validate:"required" description:"Target id of the modified setting"` TargetType *string `json:"target_type" validate:"required" description:"Target type of the modified setting"` TargetDetails *string `json:"target_details" validate:"required" description:"Details of the target of the modified setting"` parsers.PantherLog }
Audit is a a GitLab log line from a failed interaction with git nolint: lll
type AuditParser ¶
type AuditParser struct{}
AuditParser parses gitlab rails logs
func (*AuditParser) LogType ¶
func (p *AuditParser) LogType() string
LogType returns the log type supported by this parser
func (*AuditParser) Parse ¶
func (p *AuditParser) Parse(log string) ([]*parsers.PantherLog, error)
Parse returns the parsed events or nil if parsing failed
type Exceptions ¶
type Exceptions struct { Severity *string `json:"severity" validate:"required" description:"The log level"` Time *timestamp.RFC3339 `json:"time" validate:"required" description:"The event timestamp"` CorrelationID *string `json:"correlation_id,omitempty" description:"Request unique id across logs"` ExtraServer *ExtraServer `json:"extra.server,omitempty" description:"Information about the server on which the exception occurred"` ExtraProjectID *int64 `json:"extra.project_id,omitempty" description:"Project id where the exception occurred"` ExtraRelationKey *string `json:"extra.relation_key,omitempty" description:"Relation on which the exception occurred"` ExtraRelationIndex *int64 `json:"extra.relation_index,omitempty" description:"Relation index on which the exception occurred"` ExceptionClass *string `json:"exception.class" validate:"required" description:"Class name of the exception that occurred"` ExceptionMessage *string `json:"exception.message" validate:"required" description:"Message of the exception that occurred"` ExceptionBacktrace []string `json:"exception.backtrace,omitempty" description:"Stack trace of the exception that occurred"` parsers.PantherLog }
Exceptions is a a GitLab log line from a failed interaction with git nolint: lll
type ExceptionsParser ¶
type ExceptionsParser struct{}
ExceptionsParser parses gitlab rails logs
func (*ExceptionsParser) LogType ¶
func (p *ExceptionsParser) LogType() string
LogType returns the log type supported by this parser
func (*ExceptionsParser) New ¶
func (p *ExceptionsParser) New() parsers.LogParser
New creates a new parser
func (*ExceptionsParser) Parse ¶
func (p *ExceptionsParser) Parse(log string) ([]*parsers.PantherLog, error)
Parse returns the parsed events or nil if parsing failed
type ExtraServer ¶
type ExtraServer struct { OS *ServerOS `json:"os" validation:"required" description:"Server OS info"` Runtime *ServerRuntime `json:"runtime" validation:"required" description:"Runtime executing gitlab code"` }
ExtraServer has info about the server an exception occurred
type Git ¶
type Git struct { Severity *string `json:"severity" validate:"required" description:"The log level"` Time *timestamp.RFC3339 `json:"time" validate:"required" description:"The event timestamp"` CorrelationID *string `json:"correlation_id,omitempty" description:"Unique id across logs"` Message *string `json:"message" validate:"required" description:"The error message from git"` parsers.PantherLog }
Git is a a GitLab log line from a failed interaction with git
type GitParser ¶
type GitParser struct{}
GitParser parses gitlab rails logs
type Integrations ¶
type Integrations struct { Severity *string `json:"severity" validate:"required" description:"The log level"` Time *timestamp.RFC3339 `json:"time" validate:"required" description:"The event timestamp"` ServiceClass *string `json:"service_class" validate:"required" description:"The class name of the integrated service"` ProjectID *int64 `json:"project_id" validate:"required" description:"The project id the integration was running on"` ProjectPath *string `json:"project_path" validate:"required" description:"The project path the integration was running on"` Message *string `json:"message" validate:"required" description:"The log message from the service"` ClientURL *string `json:"client_url" validate:"required" description:"The client url of the service"` Error *string `json:"error,omitempty" description:"The error name if an error has occurred"` parsers.PantherLog }
Integrations is a a GitLab log line from an integrated gitlab activity
type IntegrationsParser ¶
type IntegrationsParser struct{}
IntegrationsParser parses gitlab integration logs
func (*IntegrationsParser) LogType ¶
func (p *IntegrationsParser) LogType() string
LogType returns the log type supported by this parser
func (*IntegrationsParser) New ¶
func (p *IntegrationsParser) New() parsers.LogParser
New creates a new parser
func (*IntegrationsParser) Parse ¶
func (p *IntegrationsParser) Parse(log string) ([]*parsers.PantherLog, error)
Parse returns the parsed events or nil if parsing failed
type QueryParam ¶
type QueryParam struct { Key *string `json:"key" validate:"required" description:"Query parameter name"` Value *string `json:"value,omitempty" description:"Query parameter value"` }
QueryParam is an HTTP query param as logged by LogRage
type Rails ¶
type Rails struct { Method *string `json:"method" validate:"required" description:"The HTTP method of the request"` Path *string `json:"path" validate:"required" description:"The URL path for the request"` Format *string `json:"format" validate:"required" description:"The response output format"` Controller *string `json:"controller" validate:"required" description:"The Rails controller class name"` Action *string `json:"action" validate:"required" description:"The Rails controller action"` Status *int `json:"status" validate:"required" description:"The HTTP response status code"` Duration *float32 `json:"duration" validate:"required" description:"The time spent serving the request (in milliseconds)"` View *float32 `json:"view,omitempty" description:"The time spent rendering the view for the Rails controller (in milliseconds)"` DB *float32 `json:"db,omitempty" description:"The time spent quering the database (in milliseconds)"` Time *timestamp.RFC3339 `json:"time" validate:"required" description:"The request timestamp"` Params []QueryParam `json:"params,omitempty" description:"The URL query parameters"` RemoteIP *string `json:"remote_ip,omitempty" description:"The remote IP address of the HTTP request"` UserID *int64 `json:"user_id,omitempty" description:"The user id of the request"` UserName *string `json:"username,omitempty" description:"The username of the request"` GitalyCalls *int `json:"gitaly_calls,omitempty" description:"Total number of calls made to Gitaly"` GitalyDuration *float32 `json:"gitaly_duration,omitempty" description:"Total time taken by Gitaly calls"` QueueDuration *float32 `json:"queue_duration,omitempty" description:"Total time that the request was queued inside GitLab Workhorse"` CorrelationID *string `json:"correlation_id,omitempty" description:"Request unique id across logs"` UserAgent *string `json:"ua,omitempty" description:"User-Agent HTTP header"` CPUSeconds *float32 `json:"cpu_s,omitempty" description:"CPU seconds"` // TODO: Check what this field information is about ExceptionClass *string `json:"exception.class,omitempty" description:"Class name of the exception that occurred"` ExceptionMessage *string `json:"exception.message,omitempty" description:"Message of the exception that occurred"` ExceptionBacktrace []string `json:"exception.backtrace,omitempty" description:"Stack trace of the exception that occurred"` parsers.PantherLog }
Rails is a a GitLab Rails controller log line from a non-API endpoint TODO: Check more samples from [Lograge](https://github.com/roidrage/lograge/) JSON output to find missing fields nolint:lll
type RailsParser ¶
type RailsParser struct{}
RailsParser parses gitlab rails logs
func (*RailsParser) LogType ¶
func (p *RailsParser) LogType() string
LogType returns the log type supported by this parser
func (*RailsParser) Parse ¶
func (p *RailsParser) Parse(log string) ([]*parsers.PantherLog, error)
Parse returns the parsed events or nil if parsing failed
type ServerOS ¶
type ServerOS struct { Name *string `json:"name" validation:"required" description:"OS name"` Version *string `json:"version" validation:"required" description:"OS version"` Build *string `json:"build" validation:"required" description:"OS build"` }
ServerOS has info about the OS where an exception occurred
type ServerRuntime ¶
type ServerRuntime struct { Name *string `json:"name" validation:"required" description:"Runtime name"` Version *string `json:"version" validation:"required" description:"Runtime version"` }
ServerRuntime has info about the runtime where an exception occurred