Documentation ¶
Index ¶
- type CriParser
- type DockerLog
- type DockerParser
- func (j *DockerParser) MarshalJSON() ([]byte, error)
- func (j *DockerParser) MarshalJSONBuf(buf fflib.EncodingBuffer) error
- func (p *DockerParser) Parse(line string, log *types.Log) (message string, isPartial bool, err error)
- func (j *DockerParser) UnmarshalJSON(input []byte) error
- func (j *DockerParser) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error
- type KubernetesParser
- type LogTypeParser
- type PlaintextParser
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CriParser ¶
type CriParser struct {
// contains filtered or unexported fields
}
func NewCriParser ¶
func NewCriParser() *CriParser
type DockerLog ¶
type DockerLog struct { Log string `json:"log"` Stream string `json:"stream"` Time string `json:"time"` }
DockerLog is the format from docker json logs
func (*DockerLog) MarshalJSON ¶
MarshalJSON marshal bytes to json - template
func (*DockerLog) MarshalJSONBuf ¶
func (j *DockerLog) MarshalJSONBuf(buf fflib.EncodingBuffer) error
MarshalJSONBuf marshal buff to json - template
func (*DockerLog) UnmarshalJSON ¶
UnmarshalJSON umarshall json - template of ffjson
func (*DockerLog) UnmarshalJSONFFLexer ¶
UnmarshalJSONFFLexer fast json unmarshall - template ffjson
type DockerParser ¶
type DockerParser struct {
// contains filtered or unexported fields
}
func NewDockerParser ¶
func NewDockerParser() *DockerParser
func (*DockerParser) MarshalJSON ¶
func (j *DockerParser) MarshalJSON() ([]byte, error)
MarshalJSON marshal bytes to json - template
func (*DockerParser) MarshalJSONBuf ¶
func (j *DockerParser) MarshalJSONBuf(buf fflib.EncodingBuffer) error
MarshalJSONBuf marshal buff to json - template
func (*DockerParser) Parse ¶
func (p *DockerParser) Parse(line string, log *types.Log) (message string, isPartial bool, err error)
Parse parses logs in the Docker json log format and combines partial logs. Not safe for concurrent use.
func (*DockerParser) UnmarshalJSON ¶
func (j *DockerParser) UnmarshalJSON(input []byte) error
UnmarshalJSON umarshall json - template of ffjson
func (*DockerParser) UnmarshalJSONFFLexer ¶
func (j *DockerParser) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error
UnmarshalJSONFFLexer fast json unmarshall - template ffjson
type KubernetesParser ¶
type KubernetesParser struct {
// contains filtered or unexported fields
}
KubernetesParser is a parser for Kubernetes logs. Discovers the log type and parses with the docker or cri parser. Not safe for concurrent use.
func NewKubernetesParser ¶
func NewKubernetesParser() *KubernetesParser
NewKubernetesParser creates a new KubernetesParser.
type LogTypeParser ¶
type LogTypeParser interface { // Parse parses a line of text from a file into a log. Parse(line string, log *types.Log) (message string, isPartial bool, err error) }
LogTypeParser is a function that parses a line of text from a file based on its format. Must assign log.Timestamp, log.ObservedTimestamp, and the types.BodyKeyMessage property of log.Body.
func GetLogTypeParser ¶
func GetLogTypeParser(logType Type) LogTypeParser
type PlaintextParser ¶
type PlaintextParser struct{}
type Type ¶
type Type string
const ( // Docker logs are the json formatted logs from the docker daemon LogTypeDocker Type = "docker" // Cri logs are the logs from the container runtime interface LogTypeCri Type = "cri" // Kubernetes logs can be in either docker or cri format LogTypeKubernetes Type = "kubernetes" // Plain logs are logs that are not in a known format LogTypePlain Type = "plain" )