Skip to content

Latest commit

 

History

History
173 lines (119 loc) · 3.59 KB

File metadata and controls

173 lines (119 loc) · 3.59 KB

Socket plugin

It sends events to a socket endpoint. Supports TCP, UDP, and Unix socket protocols.

Events are sent in batches serialized as newline-delimited JSON by default, compatible with the socket input plugin. The delimiter used to separate messages is configurable and can be changed in the plugin configuration (default: \n). If a network error occurs, the batch will be retried according to the backoff settings.

Supports dead queue.

Examples

TCP:

pipelines:
  example_pipeline:
    ...
    output:
      type: socket
      network: tcp
      address: ':6666'
      delimiter: '\t'
    ...

TLS:

pipelines:
  example_pipeline:
    ...
    output:
      type: socket
      network: tcp
      address: ':6666'
      delimiter: '\n'
      ca_cert: './client.pem'
      private_key: './client.key'
    ...

UDP:

pipelines:
  example_pipeline:
    ...
    output:
      type: socket
      network: udp
      address: '[2001:db8::1]:1234'
    ...

Unix:

pipelines:
  example_pipeline:
    ...
    output:
      type: socket
      network: unix
      address: '/tmp/filed.sock'
    ...

Config params

network string default=tcp options=tcp|udp|unix

Which network protocol to use for the outgoing connection.


address string required

Remote address to connect to.

Examples:

  • 1.2.3.4:6666
  • :6666
  • /tmp/filed.sock

delimiter string default=\n

Delimiter to append after each event. Must be exactly one byte.


ca_cert string

Client certificate in PEM encoding. This can be a path or the contents of the file.

Enables TLS. Works only when network is tcp.


private_key string

Client private key in PEM encoding. This can be a path or the contents of the file.

Enables TLS. Works only when network is tcp.


dial_timeout cfg.Duration default=5s

It defines how much time to wait for the connection.


write_timeout cfg.Duration default=5s

Timeout for writing a single batch to the socket.

Set to 0 to disable. Must be at least 1s if non-zero.


reconnect_interval cfg.Duration default=1m

The plugin reconnects to endpoint periodically using this interval. It is useful if an endpoint is a load balancer.


workers_count cfg.Expression default=gomaxprocs*4

It defines how many workers will be instantiated to send batches.


batch_size cfg.Expression default=capacity/4

A maximum quantity of events to pack into one batch.


batch_size_bytes cfg.Expression default=0

A minimum size of events in a batch to send. If both batch_size and batch_size_bytes are set, they will work together.


batch_flush_timeout cfg.Duration default=200ms

After this timeout batch will be sent even if batch isn't full.


retry int default=10

Retries of insertion. If File.d cannot insert for this number of attempts, File.d will fall with non-zero exit code or skip message (see fatal_on_failed_insert).


fatal_on_failed_insert bool default=false

After an insert error, fall with a non-zero exit code or not. A configured deadqueue disables fatal exits.


retention cfg.Duration default=1s

Retention milliseconds for retry to socket.


retention_exponentially_multiplier int default=2

Multiplier for exponential increase of retention between retries



Generated using insane-doc