input

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 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
	DropIfChannelFull bool
	PerfStats         SocketInputPerfStats
	StatsEncoder      *util.PerformanceStatsEncoder
}

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

func MakeSocketInput

func MakeSocketInput(inputSocket string,
	outChan chan types.Entry, bufDrop bool) (*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.

func (*SocketInput) SubmitStats added in v1.1.0

func (si *SocketInput) SubmitStats(sc *util.PerformanceStatsEncoder)

SubmitStats registers a PerformanceStatsEncoder for runtime stats submission.

type SocketInputPerfStats added in v1.1.0

type SocketInputPerfStats struct {
	SocketQueueLength  uint64 `influx:"input_queue_length"`
	SocketQueueDropped uint64 `influx:"input_queue_dropped"`
}

SocketInputPerfStats contains performance stats written to InfluxDB for monitoring.

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 standard input.

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