Socket
Deliver logs to a remote socket endpoint
status: stable
delivery: best effort
acknowledgements: no
egress: stream
state: stateless
Configuration
Example configurations
{
"sinks": {
"my_sink_id": {
"type": "socket",
"inputs": [
"my-source-or-transform-id"
],
"address": "92.12.333.224:5000",
"mode": "tcp",
"encoding": {
"codec": "json"
},
"healthcheck": null,
"path": "/path/to/socket"
}
}
}
[sinks.my_sink_id]
type = "socket"
inputs = [ "my-source-or-transform-id" ]
address = "92.12.333.224:5000"
mode = "tcp"
path = "/path/to/socket"
[sinks.my_sink_id.encoding]
codec = "json"
---
sinks:
my_sink_id:
type: socket
inputs:
- my-source-or-transform-id
address: 92.12.333.224:5000
mode: tcp
encoding:
codec: json
healthcheck: null
path: /path/to/socket
{
"sinks": {
"my_sink_id": {
"type": "socket",
"inputs": [
"my-source-or-transform-id"
],
"address": "92.12.333.224:5000",
"mode": "tcp",
"buffer": null,
"encoding": {
"codec": "json"
},
"healthcheck": null,
"send_buffer_bytes": 65536,
"keepalive": null,
"tls": null,
"path": "/path/to/socket"
}
}
}
[sinks.my_sink_id]
type = "socket"
inputs = [ "my-source-or-transform-id" ]
address = "92.12.333.224:5000"
mode = "tcp"
send_buffer_bytes = 65_536
path = "/path/to/socket"
[sinks.my_sink_id.encoding]
codec = "json"
---
sinks:
my_sink_id:
type: socket
inputs:
- my-source-or-transform-id
address: 92.12.333.224:5000
mode: tcp
buffer: null
encoding:
codec: json
healthcheck: null
send_buffer_bytes: 65536
keepalive: null
tls: null
path: /path/to/socket
address
required string literalThe address to connect to. The address must include a port.
Relevant when:
mode = `tcp` or `udp`
buffer
optional objectConfigures the sink specific buffer behavior.
buffer.max_events
optional uintThe maximum number of events allowed in the buffer.
Relevant when:
type = "memory"
default:
500
(events)buffer.type
optional string literal enumThe buffer’s type and storage mechanism.
Enum options
Option | Description |
---|---|
disk | Stores the sink’s buffer on disk. This is less performant, but durable. Data will not be lost between restarts. Will also hold data in memory to enhance performance. WARNING: This may stall the sink if disk performance isn’t on par with the throughput. For comparison, AWS gp2 volumes are usually too slow for common cases. |
memory | Stores the sink’s buffer in memory. This is more performant, but less durable. Data will be lost if Vector is restarted forcefully. |
default:
memory
buffer.when_full
optional string literal enumThe behavior when the buffer becomes full.
Enum options
Option | Description |
---|---|
block | Applies back pressure when the buffer is full. This prevents data loss, but will cause data to pile up on the edge. |
drop_newest | Drops new data as it’s received. This data is lost. This should be used when performance is the highest priority. |
default:
block
encoding
required objectConfigures the encoding specific sink behavior.
Note: When data in encoding
is malformed, currently only a very generic error “data did not match any variant of untagged enum EncodingConfig” is reported. Follow this issue to track progress on improving these error messages.
encoding.codec
optional string literal enumThe encoding codec used to serialize the events before outputting.
Enum options
Option | Description |
---|---|
json | JSON encoded event. |
text | The message field from the event. |
encoding.except_fields
optional [string]Prevent the sink from encoding the specified fields.
encoding.only_fields
optional [string]Makes the sink encode only the specified fields.
encoding.timestamp_format
optional string literal enumHow to format event timestamps.
Enum options
Option | Description |
---|---|
rfc3339 | Formats as a RFC3339 string |
unix | Formats as a unix timestamp |
default:
rfc3339
inputs
required [string]A list of upstream source or transform
IDs. Wildcards (*
) are supported.
See configuration for more info.
keepalive
optional objectConfigures the TCP keepalive behavior for the connection to the sink.
keepalive.time_secs
optional uintThe time a connection needs to be idle before sending TCP keepalive probes.
mode
required string literal enumThe type of socket to use.
Enum options
string
literal
Option | Description |
---|---|
tcp | TCP socket |
udp | UDP socket |
unix | Unix domain socket |
path
required string literalThe unix socket path. This should be the absolute path.
Relevant when:
mode = `unix`
send_buffer_bytes
optional uintConfigures the send buffer size using the
SO_SNDBUF
option on the socket.Relevant when:
mode = `tcp` or mode = `udp`
tls
optional objectConfigures the TLS options for outgoing connections.
tls.ca_file
optional string literalAbsolute path to an additional CA certificate file, in DER or PEM format (X.509), or an inline CA certificate in PEM format.
tls.crt_file
optional string literalAbsolute path to a certificate file used to identify this connection, in DER or PEM format (X.509) or PKCS#12, or an inline certificate in PEM format. If this is set and is not a PKCS#12 archive,
key_file
must also be set.tls.key_file
optional string literalAbsolute path to a private key file used to identify this connection, in DER or PEM format (PKCS#8), or an inline private key in PEM format. If this is set,
crt_file
must also be set.tls.key_pass
optional string literalPass phrase used to unlock the encrypted key file. This has no effect unless
key_file
is set.tls.verify_certificate
optional boolIf
true
(the default), Vector will validate the TLS certificate of the remote host.default:
true
tls.verify_hostname
optional boolIf
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.default:
true
Telemetry
Metrics
linkbuffer_byte_size
gaugeThe number of bytes current in the buffer.
component_id
required
The Vector component ID.
component_kind
required
The Vector component kind.
component_name
required
Deprecated, use
component_id
instead. The value is the same as component_id
.component_type
required
The Vector component type.
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
buffer_discarded_events_total
counterThe number of events dropped by this non-blocking buffer.
component_id
required
The Vector component ID.
component_kind
required
The Vector component kind.
component_name
required
Deprecated, use
component_id
instead. The value is the same as component_id
.component_type
required
The Vector component type.
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
buffer_events
gaugeThe number of events currently in the buffer.
component_id
required
The Vector component ID.
component_kind
required
The Vector component kind.
component_name
required
Deprecated, use
component_id
instead. The value is the same as component_id
.component_type
required
The Vector component type.
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
buffer_received_event_bytes_total
counterThe number of bytes received by this buffer.
component_id
required
The Vector component ID.
component_kind
required
The Vector component kind.
component_name
required
Deprecated, use
component_id
instead. The value is the same as component_id
.component_type
required
The Vector component type.
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
buffer_received_events_total
counterThe number of events received by this buffer.
component_id
required
The Vector component ID.
component_kind
required
The Vector component kind.
component_name
required
Deprecated, use
component_id
instead. The value is the same as component_id
.component_type
required
The Vector component type.
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
buffer_sent_event_bytes_total
counterThe number of bytes sent by this buffer.
component_id
required
The Vector component ID.
component_kind
required
The Vector component kind.
component_name
required
Deprecated, use
component_id
instead. The value is the same as component_id
.component_type
required
The Vector component type.
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
buffer_sent_events_total
counterThe number of events sent by this buffer.
component_id
required
The Vector component ID.
component_kind
required
The Vector component kind.
component_name
required
Deprecated, use
component_id
instead. The value is the same as component_id
.component_type
required
The Vector component type.
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
component_received_event_bytes_total
counterThe number of event bytes accepted by this component either from
tagged origins like file and uri, or cumulatively from other origins.
component_id
required
The Vector component ID.
component_kind
required
The Vector component kind.
component_name
required
Deprecated, use
component_id
instead. The value is the same as component_id
.component_type
required
The Vector component type.
container_name
optional
The name of the container from which the data originated.
file
optional
The file from which the data originated.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the data originated.
peer_path
optional
The pathname from which the data originated.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the data originated.
uri
optional
The sanitized URI from which the data originated.
component_received_events_count
histogramA histogram of Vector the number of events passed in each internal batch in Vector’s internal topology.
Note that this is separate than sink-level batching. It is mostly useful for low level debugging
performance issues in Vector due to small internal batches.
component_id
required
The Vector component ID.
component_kind
required
The Vector component kind.
component_name
required
Deprecated, use
component_id
instead. The value is the same as component_id
.component_type
required
The Vector component type.
container_name
optional
The name of the container from which the data originated.
file
optional
The file from which the data originated.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the data originated.
peer_path
optional
The pathname from which the data originated.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the data originated.
uri
optional
The sanitized URI from which the data originated.
component_received_events_total
counterThe number of events accepted by this component either from tagged
origins like file and uri, or cumulatively from other origins.
component_id
required
The Vector component ID.
component_kind
required
The Vector component kind.
component_name
required
Deprecated, use
component_id
instead. The value is the same as component_id
.component_type
required
The Vector component type.
container_name
optional
The name of the container from which the data originated.
file
optional
The file from which the data originated.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the data originated.
peer_path
optional
The pathname from which the data originated.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the data originated.
uri
optional
The sanitized URI from which the data originated.
connection_errors_total
counterThe total number of connection errors for this Vector instance.
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
events_in_total
counterThe number of events accepted by this component either from tagged
origins like file and uri, or cumulatively from other origins.
This metric is deprecated and will be removed in a future version.
Use
component_received_events_total
instead.component_id
required
The Vector component ID.
component_kind
required
The Vector component kind.
component_name
required
Deprecated, use
component_id
instead. The value is the same as component_id
.component_type
required
The Vector component type.
container_name
optional
The name of the container from which the data originated.
file
optional
The file from which the data originated.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the data originated.
peer_path
optional
The pathname from which the data originated.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the data originated.
uri
optional
The sanitized URI from which the data originated.
processed_bytes_total
counterThe number of bytes processed by the component.
component_id
required
The Vector component ID.
component_kind
required
The Vector component kind.
component_name
required
Deprecated, use
component_id
instead. The value is the same as component_id
.component_type
required
The Vector component type.
container_name
optional
The name of the container from which the bytes originate.
file
optional
The file from which the bytes originate.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the bytes originate.
peer_path
optional
The pathname from which the bytes originate.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the bytes originate.
uri
optional
The sanitized URI from which the bytes originate.
processed_events_total
counterThe total number of events processed by this component.
This metric is deprecated in place of using
component_received_events_total
and
component_sent_events_total
metrics.component_id
required
The Vector component ID.
component_kind
required
The Vector component kind.
component_name
required
Deprecated, use
component_id
instead. The value is the same as component_id
.component_type
required
The Vector component type.
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
utilization
gaugeA ratio from 0 to 1 of the load on a component. A value of 0 would indicate a completely idle component that is simply waiting for input. A value of 1 would indicate a that is never idle. This value is updated every 5 seconds.
component_id
required
The Vector component ID.
component_kind
required
The Vector component kind.
component_name
required
Deprecated, use
component_id
instead. The value is the same as component_id
.component_type
required
The Vector component type.
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
How it works
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
.