Documentation ¶
Overview ¶
Package logtailer provides an easy way to write log file munging programs
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logtailer ¶
type Logtailer struct { Logger *log.Logger Profile profiles.Profile LogFile string StateDir string DryRun bool // contains filtered or unexported fields }
Logtailer holds the state of a logtailer program which represents the consumption of an input source with a particular profile
func NewLogtailer ¶
func NewLogtailer(profile profiles.Profile, logFile string, stateDir string, logger *log.Logger) *Logtailer
NewLogtailer prepares a new Logtailer from a profile, input logfile, state directory, and a logger.
Example ¶
tmpFile, _ := ioutil.TempFile("", "") defer os.Remove(tmpFile.Name()) logger := log.New(os.Stderr, "logtailer", log.LstdFlags) tailer := NewLogtailer(&dummy.DummyProfile{}, tmpFile.Name(), "/tmp/", logger) stats, _ := tailer.Run(1) fmt.Println(stats)
Output: {"Records":0,"ParseErrors":0,"SendErrors":0}
func (*Logtailer) PrepEnvironment ¶
PrepEnvironment ensures the specified log file and state directories exist.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
logtailer
Command logtailer is designed to process log files for consumption.
|
Command logtailer is designed to process log files for consumption. |
Package profiles describes the logtailer Profile interface and provides a simple registry
|
Package profiles describes the logtailer Profile interface and provides a simple registry |
dummy
Package dummy implements a dummy skeleton logtailer profile for demonstration purposes.
|
Package dummy implements a dummy skeleton logtailer profile for demonstration purposes. |
sshd
Package sshd parses ssh log lines and generates JSON representing ssh events
|
Package sshd parses ssh log lines and generates JSON representing ssh events |
Click to show internal directories.
Click to hide internal directories.