Saves bytes to a TCP or TLS connection.
save_tcp endpoint:string, [retry_delay=duration, max_retry_count=int, tls=record]Description
Section titled “Description”Saves bytes to the given endpoint via TCP or TLS. Attempts to reconnect
automatically for max_retry_count in case of recoverable connection
errors.
endpoint: string
Section titled “endpoint: string”The endpoint to which the server will connect. Must be of the form
[tcp://]<hostname>:<port>. You can also use an IANA service name instead
of a numeric port.
retry_delay = duration (optional)
Section titled “retry_delay = duration (optional)”The amount of time to wait before attempting to reconnect in case a connection
attempt fails and the error is deemed recoverable. Defaults to 30s.
`max_retry_count = int (optional)
Section titled “`max_retry_count = int (optional)”The number of retries to attempt in case of connection errors before
transitioning into the error state. Defaults to 10.
tls = record (optional)
TLS configuration. Provide an empty record (tls={}) to enable TLS with
defaults or set fields to customize it.
{ skip_peer_verification: bool, // skip certificate verification. cacert: string, // CA bundle to verify peers. certfile: string, // client certificate to present. keyfile: string, // private key for the client certificate. min_version: string, // minimum TLS version (`"1.0"`, `"1.1"`, `"1.2"`, "1.3"`). ciphers: string, // OpenSSL cipher list string. client_ca: string, // CA to validate client certificates. require_client_cert, // require clients to present a certificate.}The client_ca and require_client_cert options are only applied
for operators that accept incoming client connections, and otherwise
ignored.
Any value not specified in the record will either be picked up from the configuration or if not configured will not be used by the operator.
See the Node TLS Setup guide for more details.
Examples
Section titled “Examples”Transform incoming Syslog to BITZ and save over TCP
Section titled “Transform incoming Syslog to BITZ and save over TCP”load_tcp "0.0.0.0:8090" { read_syslog }write_bitzsave_tcp "127.0.0.1:4000"Save to localhost with TLS
Section titled “Save to localhost with TLS”subscribe "feed"write_jsonsave_tcp "127.0.0.1:4000", tls=true, skip_peer_verification=true