TCP Sink
The Vector tcp sink streams log events to a TCP connection.
Configuration
- Common
- Advanced
[sinks.my_sink_id]# REQUIRED - Generaltype = "tcp" # example, must be: "tcp"inputs = ["my-source-id"] # exampleaddress = "92.12.333.224:5000" # example# REQUIRED - requestsencoding = "json" # example, enum
Options
address
The TCP address.
buffer
Configures the sink specific buffer.
max_size
The maximum size of the buffer on the disk.
type
The buffer's type / location. disk buffers are persistent and will be retained between restarts.
"memory""memory" "disk" when_full
The behavior when the buffer becomes full.
"block""block" "drop_newest" encoding
The encoding format used to serialize the events before outputting.
"json" "text" healthcheck
Enables/disables the sink healthcheck upon start. See Health Checks for more info.
truetls
Configures the TLS options for connections from this sink.
ca_path
Absolute path to an additional CA certificate file, in DER or PEM format (X.509).
crt_path
Absolute path to a certificate file used to identify this connection, in DER or PEM format (X.509) or PKCS#12. If this is set and is not a PKCS#12 archive, key_path must also be set.
enabled
Enable TLS during connections to the remote.
key_pass
Pass phrase used to unlock the encrypted key file. This has no effect unless key_pass above is set.
key_path
Absolute path to a certificate key file used to identify this connection, in DER or PEM format (PKCS#8). If this is set, crt_path must also be set.
verify_certificate
If true (the default), Vector will validate the TLS certificate of the remote host. Do NOT set this to false unless you understand the risks of not verifying the remote certificate.
trueverify_hostname
If true (the default), Vector will validate the configured remote host name against the remote host's TLS certificate. Do NOT set this to false unless you understand the risks of not verifying the remote hostname.
trueHow It Works
Environment Variables
Environment variables are supported through all of Vector's configuration.
Simply add ${MY_ENV_VAR} in your Vector configuration file and the variable
will be replaced before being evaluated.
You can learn more in the Environment Variables section.
Health Checks
Health checks ensure that the downstream service is accessible and ready to accept data. This check is performed upon sink initialization. If the health check fails an error will be logged and Vector will proceed to start.
Require Health Checks
If you'd like to exit immediately upon a health check failure, you can
pass the --require-healthy flag:
vector --config /etc/vector/vector.toml --require-healthy
Disable Health Checks
If you'd like to disable health checks for this sink you can set the
healthcheck option to false.
Streaming
The tcp sink streams data on a real-time
event-by-event basis. It does not batch data.