mtail

package
v3.0.0-rc13+incompatible Latest Latest
Warning

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

Go to latest
Published: May 22, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindAddress

func BindAddress(address, port string) func(*MtailServer) error

BindAddress sets the HTTP server address in MtailServer.

func BuildInfo

func BuildInfo(info string) func(*MtailServer) error

BuildInfo sets the mtail program build information in the MtailServer.

func CompileOnly

func CompileOnly(m *MtailServer) error

CompileOnly sets compile-only mode in the MtailServer.

func DumpAst

func DumpAst(m *MtailServer) error

DumpAst instructs the MtailServer's compiler to print the AST after parsing.

func DumpAstTypes

func DumpAstTypes(m *MtailServer) error

DumpAstTypes instructs the MtailServer's copmiler to print the AST after type checking.

func DumpBytecode

func DumpBytecode(m *MtailServer) error

DumpBytecode instructs the MtailServer's compiuler to print the program bytecode after code generation.

func LogFds

func LogFds(fds ...uintptr) func(*MtailServer) error

LogFds sets the file descriptors to read log lines directly in the MtailServer.

func LogPathPatterns

func LogPathPatterns(patterns ...string) func(*MtailServer) error

LogPathPatterns sets the patterns to find log paths in the MtailServer.

func OmitMetricSource

func OmitMetricSource(m *MtailServer) error

OmitMetricSource sets the MtailServer to not link created metrics to their source program.

func OmitProgLabel

func OmitProgLabel(m *MtailServer) error

OmitProgLabel sets the MtailServer to not put the program name as a label in exported metrics.

func OneShot

func OneShot(m *MtailServer) error

OneShot sets one-shot mode in the MtailServer.

func OverrideLocation

func OverrideLocation(loc *time.Location) func(*MtailServer) error

OverrideLocation sets the timezone location for log timestamps without any such information.

func ProgramPath

func ProgramPath(path string) func(*MtailServer) error

ProgramPath sets the path to find mtail programs in the MtailServer.

func SyslogUseCurrentYear

func SyslogUseCurrentYear(m *MtailServer) error

SyslogUseCurrentYear instructs the MtailServer to use the current year for year-less log timestamp during parsing.

Types

type MtailServer

type MtailServer struct {
	// contains filtered or unexported fields
}

MtailServer contains the state of the main program object.

func New

func New(store *metrics.Store, w watcher.Watcher, fs afero.Fs, options ...func(*MtailServer) error) (*MtailServer, error)

New creates a MtailServer from the supplied Options.

func (*MtailServer) Close

func (m *MtailServer) Close() error

Close handles the graceful shutdown of this mtail instance, ensuring that it only occurs once.

func (*MtailServer) Run

func (m *MtailServer) Run() error

Run starts MtailServer's primary function, in which it watches the log files for changes and sends any new lines found into the lines channel for pick up by the virtual machines. If OneShot mode is enabled, it will exit.

func (*MtailServer) Serve

func (m *MtailServer) Serve() error

Serve begins the webserver and awaits a shutdown instruction.

func (*MtailServer) ServeHTTP

func (m *MtailServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*MtailServer) SetOption

func (m *MtailServer) SetOption(options ...func(*MtailServer) error) error

SetOption takes one or more option functions and applies them in order to MtailServer.

func (*MtailServer) StartTailing

func (m *MtailServer) StartTailing() error

StartTailing constructs a new Tailer and commences sending log lines into the lines channel.

func (*MtailServer) WaitForShutdown

func (m *MtailServer) WaitForShutdown()

WaitForShutdown handles shutdown requests from the system or the UI.

func (*MtailServer) WriteMetrics

func (m *MtailServer) WriteMetrics(w io.Writer) error

WriteMetrics dumps the current state of the metrics store in JSON format to the io.Writer.

Jump to

Keyboard shortcuts

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