ztail

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package ztail provides facilities for watching a directory of logs, tailing all the files created within it and transforming the data into zng data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWarningReader added in v1.3.0

func NewWarningReader(zr zio.Reader, w Warner) zio.Reader

NewWarningReader returns a Reader that reads from zr. Any error encountered results in a call to w with the warning as prameter, and then a nil *zed.Record and nil error are returned.

Types

type Tailer

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

Tailer is a zio.Reader that watches a specified directory and starts tailing existing and newly created files in the directory for new logs. Newly written log data are transformed into *zed.Values and returned on a first-come-first serve basis.

func New

func New(zctx *zed.Context, dir string, opts anyio.ReaderOpts, warner Warner, globs ...string) (*Tailer, error)

func (*Tailer) Close

func (t *Tailer) Close() error

func (*Tailer) Read

func (t *Tailer) Read() (*zed.Value, error)

func (*Tailer) Stop

func (t *Tailer) Stop() error

Stop instructs the directory watcher and indiviual file watchers to stop watching for changes. Read will emit EOS when the remaining unread data in files has been read.

type Warner added in v1.3.0

type Warner interface {
	Warn(msg string) error
}

type WarningReader added in v1.3.0

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

func (*WarningReader) Read added in v1.3.0

func (w *WarningReader) Read() (*zed.Value, error)

Jump to

Keyboard shortcuts

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