tcp_listener

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2017 License: MIT Imports: 10 Imported by: 0

README

TCP listener service input plugin

The TCP listener is a service input plugin that listens for messages on a TCP socket and adds those messages to InfluxDB. The plugin expects messages in the Telegraf Input Data Formats.

Configuration:

This is a sample configuration for the plugin.

# Generic TCP listener
[[inputs.tcp_listener]]
  ## Address and port to host TCP listener on
  service_address = ":8094"

  ## Number of TCP messages allowed to queue up. Once filled, the
  ## TCP listener will start dropping packets.
  allowed_pending_messages = 10000

  ## Maximum number of concurrent TCP connections to allow
  max_tcp_connections = 250

  ## Data format to consume.
  ## Each data format has it's own unique set of configuration options, read
  ## more about them here:
  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
  data_format = "influx"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TcpListener

type TcpListener struct {
	ServiceAddress         string
	AllowedPendingMessages int
	MaxTCPConnections      int `toml:"max_tcp_connections"`

	sync.Mutex

	MaxConnections     selfstat.Stat
	CurrentConnections selfstat.Stat
	TotalConnections   selfstat.Stat
	PacketsRecv        selfstat.Stat
	BytesRecv          selfstat.Stat
	// contains filtered or unexported fields
}

func (*TcpListener) Description

func (t *TcpListener) Description() string

func (*TcpListener) Gather

func (t *TcpListener) Gather(_ telegraf.Accumulator) error

All the work is done in the Start() function, so this is just a dummy function.

func (*TcpListener) SampleConfig

func (t *TcpListener) SampleConfig() string

func (*TcpListener) SetParser

func (t *TcpListener) SetParser(parser parsers.Parser)

func (*TcpListener) Start

func (t *TcpListener) Start(acc telegraf.Accumulator) error

Start starts the tcp listener service.

func (*TcpListener) Stop

func (t *TcpListener) Stop()

Stop cleans up all resources

Jump to

Keyboard shortcuts

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