logparser

package
v0.0.0-...-03d6fc4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2019 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParsedLog

type ParsedLog interface {
	// Start sets the current line to view.
	Start(int)
	// CurrLine gets the current line.
	CurrLine() int
	// Len returns how many parsed lines there are.
	Len() int
	// ReadAndNext returns a parsed line or nil and advances to the next line.
	ReadAndNext() *sklog.LogPayload
	// ReadLine sets the line to the specified number and returns the parsed line at that location.
	ReadLine(int) *sklog.LogPayload
}

A ParsedLog is a view of lines in a log file. It implements methods to allow for random access as well as linear iterators.

func ParsePythonLog

func ParsePythonLog(contents string) ParsedLog

func ParseSyslog

func ParseSyslog(contents string) ParsedLog

type Parser

type Parser func(string) ParsedLog

A Parser is a function that takes the text contents of a log file and returns a ParsedLog. There is one Parser for any type of logs that we support. It typically uses regular expressions to perform any parsing. In the process of parsing the logs, it basically makes a copy of every line in the log, so be aware of that memory usage.

Jump to

Keyboard shortcuts

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