inputfile

package
v0.0.0-...-3e9a38d Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2016 License: LGPL-3.0 Imports: 16 Imported by: 0

README

gogstash input file

Synopsis

{
	"input": [
		{
			"type": "file",

			// (required)
			"path": "",

			// (optional), one of ["beginning", "end"], default: "end"
			"start_position": "end",

			// (optional), default: ".sincedb.json"
			"sincedb_path": ".sincedb.json",

			// (optional), in seconds, default: 15
			"sincedb_write_interval": 15
		}
	]
}

Details

  • type
    • Must be "file"
  • path
    • Path of file as input, seperated by line
  • start_position
    • Choose where Logstash starts initially reading files: at the beginning or at the end. The default behavior treats files like live streams and thus starts at the end. If you have old data you want to import, set this to ‘beginning’
  • sincedb_path
    • Where to write the sincedb database (keeps track of the current position of monitored log files).
  • sincedb_write_interval
    • How often (in seconds) to write a since database with the current position of monitored log files.

Documentation

Index

Constants

View Source
const (
	ModuleName = "file"
)

Variables

This section is empty.

Functions

func InitHandler

func InitHandler(confraw *config.ConfigRaw) (retconf config.TypeInputConfig, err error)

Types

type InputConfig

type InputConfig struct {
	config.InputConfig
	Path                 string `json:"path"`
	StartPos             string `json:"start_position,omitempty"` // one of ["beginning", "end"]
	SinceDBPath          string `json:"sincedb_path,omitempty"`
	SinceDBWriteInterval int    `json:"sincedb_write_interval,omitempty"`

	SinceDBInfos map[string]*SinceDBInfo `json:"-"`

	SinceDBLastSaveTime time.Time `json:"-"`
	// contains filtered or unexported fields
}

func DefaultInputConfig

func DefaultInputConfig() InputConfig

func (*InputConfig) CheckSaveSinceDBInfos

func (self *InputConfig) CheckSaveSinceDBInfos() (err error)

func (*InputConfig) CheckSaveSinceDBInfosLoop

func (self *InputConfig) CheckSaveSinceDBInfosLoop() (err error)

func (*InputConfig) LoadSinceDBInfos

func (self *InputConfig) LoadSinceDBInfos() (err error)

func (*InputConfig) SaveSinceDBInfos

func (self *InputConfig) SaveSinceDBInfos() (err error)

func (*InputConfig) Start

func (t *InputConfig) Start()

type SinceDBInfo

type SinceDBInfo struct {
	Offset int64 `json:"offset,omitempty"`
}

Jump to

Keyboard shortcuts

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