load_tcp
Loads bytes from a TCP or TLS connection.
Description
Reads bytes from the given endpoint via TCP or TLS.
endpoint: str
The endpoint at which the server will listen. If connect=true
, this is instead
the remote endpoint to connect to. Must be of the form
[tcp://]<hostname>:<port>
. Use the hostname 0.0.0.0
o accept connections on
all interfaces.
connect = bool (optional)
Connect to the endpoint instead of listening at it.
parallel = int (optional)
Maximum number of parallel connections at once.
tls = bool (optional)
Whether to use TLS.
certfile = str (optional)
Path to a .pem
file containing the TLS certificate.
keyfile = str (optional)
Path to a .pem
file containing the private key for the certificate.
{ … } (optional)
The pipeline to run for each individual TCP connection. If none is specified, no
transformations are applied to the output streams. Unless you are sure that
there is at most one active connection at a time, it is recommended to specify a
pipeline that parses the individual connection streams into events, for instance
{ read_json }
. Otherwise, the output can be interleaved.
Examples
Listen for incoming Syslog over TCP
Listen on all network interfaces, parsing each individual connection as syslog:
Connect to a remote endpoint and read JSON
Listen on localhost with TLS enabled
Wait for connections on localhost with TLS enabled, parsing incoming JSON
streams according to the schema "my_schema"
, forwarding no more than 20 events
per individual connection:
This example may use a self-signed certificate that can be generated like this:
You can test the endpoint locally by issuing a TLS connection: