NATS
Read observability data from subjects on the NATS messaging system
Configuration
Example configurations
{
"sources": {
"my_source_id": {
"type": "nats",
"url": "nats://demo.nats.io",
"connection_name": "foo",
"subject": "foo"
}
}
}
[sources.my_source_id]
type = "nats"
url = "nats://demo.nats.io"
connection_name = "foo"
subject = "foo"
---
sources:
my_source_id:
type: nats
url: nats://demo.nats.io
connection_name: foo
subject: foo
{
"sources": {
"my_source_id": {
"type": "nats",
"url": "nats://demo.nats.io",
"connection_name": "foo",
"queue": "vector",
"framing": null,
"tls": null,
"auth": null,
"subject": "foo",
"decoding": null
}
}
}
[sources.my_source_id]
type = "nats"
url = "nats://demo.nats.io"
connection_name = "foo"
queue = "vector"
subject = "foo"
---
sources:
my_source_id:
type: nats
url: nats://demo.nats.io
connection_name: foo
queue: vector
framing: null
tls: null
auth: null
subject: foo
decoding: null
auth
optional objectauth.credentials_file
optional objectcredentials_file
.auth.credentials_file.path
optional string literalauth.nkey
optional objectnkey
.auth.nkey.nkey
optional string literalauth.nkey.seed
optional string literalauth.strategy
optional string literal enumOption | Description |
---|---|
credentials_file | Credentials file authentication: https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/jwt |
nkey | Nkey authentication: https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/nkey_auth |
token | Token authentication: https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/tokens |
user_password | Username and password authentication: https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/username_password |
user_password
auth.user_password
optional objectuser_password
.connection_name
required string literaldecoding
optional objectdecoding.codec
common optional string literal enumOption | Description |
---|---|
bytes | Uses the raw bytes as-is. |
gelf | Decodes the raw bytes as a GELF message. |
json | Decodes the raw bytes as JSON. |
native | Decodes the raw bytes as Vector’s native Protocol Buffers format. This codec is experimental. |
native_json | Decodes the raw bytes as Vector’s native JSON format. This codec is experimental. |
syslog | Decodes the raw bytes as a Syslog message. Will decode either as the RFC 3164-style format (“old” style) or the more modern RFC 5424-style format (“new” style, includes structured data). |
bytes
framing
optional objectframing.character_delimited
required objectcharacter_delimited
framing.method = `character_delimited`
framing.character_delimited.delimiter
required ascii_charframing.character_delimited.max_length
optional uintmax_length
bytes will be discarded entirely.framing.method
common optional string literal enumOption | Description |
---|---|
bytes | Byte frames are passed through as-is according to the underlying I/O boundaries (e.g. split between messages or stream segments). |
character_delimited | Byte frames which are delimited by a chosen character. |
length_delimited | Byte frames which are prefixed by an unsigned big-endian 32-bit integer indicating the length. |
newline_delimited | Byte frames which are delimited by a newline character. |
octet_counting | Byte frames according to the octet counting format. |
bytes
framing.newline_delimited
optional objectnewline_delimited
framing.method = `newline_delimited`
framing.newline_delimited.max_length
optional uintmax_length
bytes will be discarded entirely.framing.octet_counting
optional objectoctet_counting
framing.method = `octet_counting`
framing.octet_counting.max_length
optional uintmax_length
bytes will be discarded entirely.subject
required string literaltls
optional objecttls.alpn_protocols
optional [string]Sets the list of supported ALPN protocols.
Declare the supported ALPN protocols, which are used during negotiation with peer. Prioritized in the order they are defined.
tls.ca_file
optional string literalAbsolute path to an additional CA certificate file.
The certificate must be in the DER or PEM (X.509) format. Additionally, the certificate can be provided as an inline string in PEM format.
tls.crt_file
common optional string literalAbsolute path to a certificate file used to identify this server.
The certificate must be in DER, PEM (X.509), or PKCS#12 format. Additionally, the certificate can be provided as an inline string in PEM format.
If this is set, and is not a PKCS#12 archive, key_file
must also be set.
tls.key_file
common optional string literalAbsolute path to a private key file used to identify this server.
The key must be in DER or PEM (PKCS#8) format. Additionally, the key can be provided as an inline string in PEM format.
tls.key_pass
optional string literalPassphrase used to unlock the encrypted key file.
This has no effect unless key_file
is set.
tls.verify_certificate
optional boolEnables certificate verification.
If enabled, certificates must be valid in terms of not being expired, as well as being issued by a trusted issuer. This verification operates in a hierarchical manner, checking that not only the leaf certificate (the certificate presented by the client/server) is valid, but also that the issuer of that certificate is valid, and so on until reaching a root certificate.
Relevant for both incoming and outgoing connections.
Do NOT set this to false
unless you understand the risks of not verifying the validity of certificates.
true
tls.verify_hostname
optional boolEnables hostname verification.
If enabled, the hostname used to connect to the remote host must be present in the TLS certificate presented by the remote host, either as the Common Name or as an entry in the Subject Alternative Name extension.
Only relevant for outgoing connections.
Do NOT set this to false
unless you understand the risks of not verifying the remote hostname.
true
url
required string literalnats://server:port
.Outputs
<component_id>
Output Data
Logs
Record
53.126.150.246 - - [01/Oct/2020:11:25:58 -0400] "GET /disintermediate HTTP/2.0" 401 20308
nats
nats.subject
Telemetry
Metrics
linkcomponent_discarded_events_total
countercomponent_id
instead. The value is the same as component_id
.component_errors_total
countercomponent_id
instead. The value is the same as component_id
.component_received_bytes_total
countercomponent_id
instead. The value is the same as component_id
.component_received_event_bytes_total
countercomponent_id
instead. The value is the same as component_id
.component_received_events_total
countercomponent_id
instead. The value is the same as component_id
.component_sent_event_bytes_total
countercomponent_id
instead. The value is the same as component_id
.component_sent_events_total
countercomponent_id
instead. The value is the same as component_id
.events_in_total
countercomponent_received_events_total
instead.component_id
instead. The value is the same as component_id
.events_out_total
countercomponent_sent_events_total
instead.component_id
instead. The value is the same as component_id
.processed_bytes_total
countercomponent_id
instead. The value is the same as component_id
.processed_events_total
countercomponent_received_events_total
and
component_sent_events_total
metrics.component_id
instead. The value is the same as component_id
.source_lag_time_seconds
histogramcomponent_id
instead. The value is the same as component_id
.