Documentation
¶
Overview ¶
Package tail implements tailing a log file.
tail provides a channel on which log lines will be sent as string messages. one line in the log file is one message on the channel
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEntries ¶
GetEntries sets up a list of channels that get one line at a time from each file down each channel.
func GetSampledEntries ¶
func GetSampledEntries(ctx context.Context, conf Config, sampleRate uint, rng *rand.Rand) ([]chan string, error)
GetSampledEntries wraps GetEntries and returns a list of channels that provide sampled entries. If rng is non-nil it will be used for sampling decisions; otherwise the global math/rand source is used.
Types ¶
type Config ¶
type Config struct {
// Path to the log file to tail
Paths []string
// Paths to exclude from tailing
FilterPaths []string
// Type of log rotation we expect on this file
Type RotateStyle
// Tail specific options
Options TailOptions
}
type RotateStyle ¶
type RotateStyle int
const ( // foo.log gets rotated to foo.log.1, new entries go to foo.log RotateStyleSyslog RotateStyle = iota // foo.log.OLDSTAMP gets closed, new entries go to foo.log.NEWSTAMP // NOT YET IMPLEMENTED RotateStyleTimestamp )
type TailOptions ¶
type TailOptions struct {
ReadFrom string `` /* 291-byte string literal not displayed */
Stop bool `` /* 182-byte string literal not displayed */
Poll bool `long:"poll" description:"use poll instead of inotify to tail files" yaml:"poll,omitempty"`
StateFile string `` /* 205-byte string literal not displayed */
HashStateFileDirPaths bool `` /* 261-byte string literal not displayed */
}
Click to show internal directories.
Click to hide internal directories.