input

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input interface {
	GetName() string
	Run()
	SetVerbose(bool)
	Stop(chan bool)
}

Input is an interface describing the behaviour for a component to handle events parsed from EVE input.

type RedisInput

type RedisInput struct {
	EventChan     chan types.Entry
	Verbose       bool
	Running       bool
	Pool          *redis.Pool
	StopChan      chan bool
	StoppedChan   chan bool
	Addr          string
	Proto         string
	Reconnecting  bool
	ParseWorkers  int
	BatchSize     int
	PerfStats     RedisInputPerfStats
	StatsEncoder  *util.PerformanceStatsEncoder
	UsePipelining bool
}

RedisInput is an Input reading JSON EVE input from Redis list.

func MakeRedisInput

func MakeRedisInput(addr string, outChan chan types.Entry, batchSize int) (*RedisInput, error)

MakeRedisInput returns a new RedisInput, where the string parameter denotes a hostname:port combination.

func MakeRedisInputSocket

func MakeRedisInputSocket(addr string, outChan chan types.Entry, batchSize int) (*RedisInput, error)

MakeRedisInputSocket returns a new RedisInput, where string parameter denotes a socket.

func (*RedisInput) GetName

func (ri *RedisInput) GetName() string

GetName returns a printable name for the input

func (*RedisInput) Run

func (ri *RedisInput) Run()

Run starts the RedisInput

func (*RedisInput) SetVerbose

func (ri *RedisInput) SetVerbose(verbose bool)

SetVerbose sets the input's verbosity level

func (*RedisInput) Stop

func (ri *RedisInput) Stop(stoppedChan chan bool)

Stop causes the RedisInput to stop reading from the Redis list and close all associated channels, including the passed notification channel.

func (*RedisInput) SubmitStats

func (ri *RedisInput) SubmitStats(sc *util.PerformanceStatsEncoder)

SubmitStats registers a PerformanceStatsEncoder for runtime stats submission.

type RedisInputPerfStats

type RedisInputPerfStats struct {
	RedisQueueLength uint64 `influx:"redis_queue_length"`
}

RedisInputPerfStats contains performance stats written to InfluxDB for monitoring.

type SocketInput

type SocketInput struct {
	EventChan     chan types.Entry
	Verbose       bool
	Running       bool
	InputListener net.Listener
	StopChan      chan bool
	StoppedChan   chan bool
}

SocketInput is an Input reading JSON EVE input from a Unix socket.

func MakeSocketInput

func MakeSocketInput(inputSocket string,
	outChan chan types.Entry) (*SocketInput, error)

MakeSocketInput returns a new SocketInput reading from the Unix socket inputSocket and writing parsed events to outChan. If no such socket could be created for listening, the error returned is set accordingly.

func (*SocketInput) GetName

func (si *SocketInput) GetName() string

GetName returns a printable name for the input

func (*SocketInput) Run

func (si *SocketInput) Run()

Run starts the SocketInput

func (*SocketInput) SetVerbose

func (si *SocketInput) SetVerbose(verbose bool)

SetVerbose sets the input's verbosity level

func (*SocketInput) Stop

func (si *SocketInput) Stop(stoppedChan chan bool)

Stop causes the SocketInput to stop reading from the socket and close all associated channels, including the passed notification channel.

type StdinInput added in v1.0.12

type StdinInput struct {
	EventChan     chan types.Entry
	Verbose       bool
	Running       bool
	InputListener net.Listener
	StopChan      chan bool
	StoppedChan   chan bool
}

StdinInput is an Input reading JSON EVE input from a Unix socket.

func MakeStdinInput added in v1.0.12

func MakeStdinInput(outChan chan types.Entry) *StdinInput

MakeStdinInput returns a new StdinInput reading from stdin and writing parsed events to outChan.

func (*StdinInput) GetName added in v1.0.12

func (si *StdinInput) GetName() string

GetName returns a printable name for the input

func (*StdinInput) Run added in v1.0.12

func (si *StdinInput) Run()

Run starts the StdinInput

func (*StdinInput) SetVerbose added in v1.0.12

func (si *StdinInput) SetVerbose(verbose bool)

SetVerbose sets the input's verbosity level

func (*StdinInput) Stop added in v1.0.12

func (si *StdinInput) Stop(stoppedChan chan bool)

Stop causes the StdinInput to stop reading from stdin and close all associated channels, including the passed notification channel.

Jump to

Keyboard shortcuts

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