Skip to main content
Version: 3.5.0

Input: tcp

Listen for incoming TCP connections (or write to existing server)

Note that if there is a break in connection, there may be data loss. If a more robust transport is needed, use http (or even rabbitmq).

Field Summary

Field NameTypeDescriptionDefault
addresshost:portThe bind address for the socket in ip address:host format.-
plainboolExtract only the payload, ignoring metadatafalse
rawboolDo not wrap incoming data in JSON format (i.e. `{"_raw":"some data"})false
clientboolTreat as TCP client, not server. Then a server must be listening on the specified portfalse
ignore-line-breaksboolDo not treat separate lines as distinct eventsfalse
encodingstringThe encoding for plain text receivedUTF-8
line-sizeintegerThe maximum number of bytes after which a linebreak is enforced10000

Fields

address

Type: host:port

The bind address for the socket in ip address:host format.

Example

Pipe Language Snippet:

tcp:
address: 127.0.0.1:8000

plain

Type: bool

Default: false

Extract only the payload, ignoring metadata

If this is false, you get these fields in the event, otherwise just contents of _raw

  • _raw the data
  • source_ip
  • source_port
  • received_time
  • receiver_port
  • protocol "#TCP"

Example

Pipe Language Snippet:

tcp:
address: 127.0.0.1:8000
plain: true

raw

Type: bool
Alias: json
Default: false

Do not wrap incoming data in JSON format (i.e. `{"_raw":"some data"})

This is often useful when incoming data is already in JSON format.

Example

Pipe Language Snippet:

tcp:
address: 127.0.0.1:8000
raw: true

client

Type: bool

Default: false

Treat as TCP client, not server. Then a server must be listening on the specified port

ignore-line-breaks

Type: bool
Alias: ignore-linebreaks
Default: false

Do not treat separate lines as distinct events

Example

Pipe Language Snippet:

tcp:
address: 127.0.0.1:8000
ignore-linebreaks: true

encoding

Type: string

Default: UTF-8

The encoding for plain text received

line-size

Type: integer

Default: 10000

The maximum number of bytes after which a linebreak is enforced