inputdockerlog

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: 18 Imported by: 0

README

gogstash input docker

Synopsis

{
	"input": [
		{
			"type": "dockerlog",

			// (optional), docker endpoint, default: "unix:///var/run/docker.sock"
			"dockerurl": "unix:///var/run/docker.sock",

			// (optional), include docker name pattern, support regular expression of golang, default: []
			"include_patterns": [],

			// (optional), exclude docker name pattern, support regular expression of golang, default: ["gogstash"]
			"exclude_patterns": ["gogstash"],

			// (optional), sincedb storage path, default: "sincedb"
			"sincepath": "sincedb",

			// (optional), in seconds, docker connection retry interval, default: 10
			"connection_retry_interval": 10
		}
	]
}

Documentation

Index

Constants

View Source
const (
	ModuleName = "dockerlog"
)

Variables

This section is empty.

Functions

func GetContainerInfo

func GetContainerInfo(container interface{}) (id string, name string, err error)

func InitHandler

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

Types

type ContainerLogStream

type ContainerLogStream struct {
	io.Writer
	ID string
	// contains filtered or unexported fields
}

func NewContainerLogStream

func NewContainerLogStream(inchan config.InChan, id string, eventExtra map[string]interface{}, since *time.Time, logger *logrus.Logger) ContainerLogStream

func (*ContainerLogStream) Write

func (t *ContainerLogStream) Write(p []byte) (n int, err error)

type ErrorContainerLogLoopRunning

type ErrorContainerLogLoopRunning struct {
	ID string
}

func (*ErrorContainerLogLoopRunning) Error

type InputConfig

type InputConfig struct {
	config.InputConfig
	DockerURL               string   `json:"dockerurl"`
	IncludePatterns         []string `json:"include_patterns"`
	ExcludePatterns         []string `json:"exclude_patterns"`
	SincePath               string   `json:"sincepath"`
	StartPos                string   `json:"start_position,omitempty"` // one of ["beginning", "end"]
	ConnectionRetryInterval int      `json:"connection_retry_interval,omitempty"`
	// contains filtered or unexported fields
}

func DefaultInputConfig

func DefaultInputConfig() InputConfig

func (*InputConfig) Start

func (t *InputConfig) Start()

type SinceDB

type SinceDB struct {
	SinceMap map[string]*SinceFile
	// contains filtered or unexported fields
}

func MustNewSinceDB

func MustNewSinceDB(dbdir string) (sincedb *SinceDB)

func NewSinceDB

func NewSinceDB(dbdir string) (sincedb *SinceDB, err error)

func (*SinceDB) Close

func (t *SinceDB) Close() (err error)

func (*SinceDB) Del

func (t *SinceDB) Del(id string) (err error)

func (*SinceDB) Get

func (t *SinceDB) Get(id string) (since *time.Time, err error)

func (*SinceDB) Open

func (t *SinceDB) Open(dbdir string) (err error)

type SinceFile

type SinceFile struct {
	Since *time.Time
	// contains filtered or unexported fields
}

func NewSinceFile

func NewSinceFile(filepath string) (sincefile *SinceFile, err error)

func (*SinceFile) Close

func (t *SinceFile) Close() (err error)

func (*SinceFile) Open

func (t *SinceFile) Open(filepath string) (err error)

Jump to

Keyboard shortcuts

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