file

package
v0.0.0-...-bb20dc4 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileOutput

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

func (*FileOutput) Init

func (self *FileOutput) Init(pcf *plugins.PluginCommonConfig, conf toml.Primitive) error

func (*FileOutput) Run

func (self *FileOutput) Run(runner plugins.OutputRunner) error

type FileOutputConfig

type FileOutputConfig struct {
	// Full output file path.
	// If date rotation is in use, then the output file name can support
	// Go's time.Format syntax to embed timestamps in the filename:
	// http://golang.org/pkg/time/#Time.Format
	Path string

	// Output file permissions (default "644").
	Perm string

	// Interval at which the output file should be rotated, in hours.
	// Only the following values are allowed: 0, 1, 4, 12, 24
	// The files will be named relative to midnight of the day.
	// (default 0, i.e. disabled). Set to 0 to disable.
	RotationInterval uint32 `toml:"rotation_interval"`

	// Interval at which accumulated file data should be written to disk, in
	// milliseconds (default 1000, i.e. 1 second). Set to 0 to disable.
	FlushInterval uint32 `toml:"flush_interval"`

	// Permissions to apply to directories created for FileOutput's parent
	// directory if it doesn't exist.  Must be a string representation of an
	// octal integer. Defaults to "700".
	FolderPerm string `toml:"folder_perm"`
}

type Logfile

type Logfile struct {
	FileName string
	// The raw string matches from the filename, keys being the strings, values
	// are the portion that was matched
	StringMatchParts map[string]string
	// The matched portions of the filename and their translated integer value
	// MatchParts maps to integers used for sorting the Logfile within the
	// Logstream
	MatchParts map[string]int
}

Represents an individual Logfile which is part of a Logstream

type Logfiles

type Logfiles []*Logfile

Alias for a slice of logfiles, used mainly for sorting algorithms

func ScanDirectoryForLogfiles

func ScanDirectoryForLogfiles(directoryPath string, fileMatch *regexp.Regexp) Logfiles

Scans a directory recursively filtering out files that match the fileMatch regexp

func (Logfiles) FileNames

func (l Logfiles) FileNames() []string

Returns a list of all the filenames in their current order

func (Logfiles) FilterOld

func (l Logfiles) FilterOld(oldTime time.Time) Logfiles

Returns a Logfiles only containing logfiles newer than oldTime based on the files last modified file attribute

func (Logfiles) IndexOf

func (l Logfiles) IndexOf(s string) int

Locate the index of a given filename if its present in the logfiles for this stream Returns -1 if the filename is not present

func (Logfiles) Len

func (l Logfiles) Len() int

Implement two of the sort.Interface methods needed

func (Logfiles) Swap

func (l Logfiles) Swap(i, j int)

type StdoutOutput

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

func (*StdoutOutput) Init

func (self *StdoutOutput) Init(pcf *plugins.PluginCommonConfig, conf toml.Primitive) error

func (*StdoutOutput) Run

func (self *StdoutOutput) Run(runner plugins.OutputRunner) (err error)

type TailInput

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

func (*TailInput) Init

func (this *TailInput) Init(pcf *plugins.PluginCommonConfig, conf toml.Primitive) (err error)

func (*TailInput) Run

func (this *TailInput) Run(runner plugins.InputRunner) (err error)

type TailInputConfig

type TailInputConfig struct {
	Path         string
	PosFile      string `toml:"pos_file"`
	SyncInterval int    `toml:"sync_interval"`
	OffsetValue  int64
}

type TailsInput

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

func (*TailsInput) ExistInQueue

func (this *TailsInput) ExistInQueue(file string) bool

func (*TailsInput) Init

func (this *TailsInput) Init(pcf *plugins.PluginCommonConfig, conf toml.Primitive) (err error)

func (*TailsInput) Run

func (this *TailsInput) Run(runner plugins.InputRunner) (err error)

func (*TailsInput) Tailer

func (this *TailsInput) Tailer(f string) error

func (*TailsInput) Watcher

func (this *TailsInput) Watcher()

type TailsInputConfig

type TailsInputConfig struct {
	// Log base directory to run log regex under
	LogDirectory string `toml:"log_directory"`
	// Journal base directory for saving journal files
	JournalDirectory string `toml:"journal_directory"`
	// File match for regular expression
	FileMatch      string `toml:"file_match"`
	SyncInterval   int    `toml:"sync_interval"`
	RescanInterval string `toml:"rescan_interval"`
}

Jump to

Keyboard shortcuts

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