Skip to content

Commit

Permalink
docs(logstash source): use auto-generated config docs (vectordotdev#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
neuronull authored Jan 24, 2023
1 parent c35e50d commit 6bcdde7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 29 deletions.
9 changes: 6 additions & 3 deletions src/sources/logstash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use crate::{
#[configurable_component(source("logstash"))]
#[derive(Clone, Debug)]
pub struct LogstashConfig {
/// The socket address to listen for connections on.
#[configurable(derived)]
address: SocketListenAddr,

#[configurable(derived)]
Expand All @@ -48,12 +48,15 @@ pub struct LogstashConfig {
#[configurable(derived)]
tls: Option<TlsSourceConfig>,

/// The size, in bytes, of the receive buffer used for each connection.
/// The size of the receive buffer used for each connection.
///
/// This should not typically needed to be changed.
/// This generally should not need to be changed.
#[configurable(metadata(docs::type_unit = "bytes"))]
#[configurable(metadata(docs::examples = 65536))]
receive_buffer_bytes: Option<usize>,

/// The maximum number of TCP connections that will be allowed at any given time.
#[configurable(metadata(docs::type_unit = "connections"))]
connection_limit: Option<u32>,

#[configurable(derived)]
Expand Down
22 changes: 16 additions & 6 deletions website/cue/reference/components/sources/base/logstash.cue
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@ base: components: sources: logstash: configuration: {
}
}
address: {
description: "The socket address to listen for connections on."
required: true
description: """
The socket address to listen for connections on, or `systemd{#N}` to use the Nth socket passed by
systemd socket activation.
If a socket address is used, it _must_ include a port.
"""
required: true
type: string: examples: ["0.0.0.0:9000", "systemd", "systemd#3"]
}
connection_limit: {
description: "The maximum number of TCP connections that will be allowed at any given time."
required: false
type: uint: {}
type: uint: unit: "connections"
}
keepalive: {
description: "TCP keepalive settings for socket-based components."
Expand All @@ -40,12 +45,17 @@ base: components: sources: logstash: configuration: {
}
receive_buffer_bytes: {
description: """
The size, in bytes, of the receive buffer used for each connection.
The size of the receive buffer used for each connection.
This should not typically needed to be changed.
This generally should not need to be changed.
"""
required: false
type: uint: {}
type: uint: {
examples: [
65536,
]
unit: "bytes"
}
}
tls: {
description: "TlsEnableableConfig for `sources`, adding metadata from the client certificate"
Expand Down
22 changes: 2 additions & 20 deletions website/cue/reference/components/sources/logstash.cue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ components: sources: logstash: {

features: {
acknowledgements: true
auto_generated: true
receive: {
from: {
service: services.logstash
Expand Down Expand Up @@ -50,26 +51,7 @@ components: sources: logstash: {
platform_name: null
}

configuration: {
acknowledgements: configuration._source_acknowledgements
address: {
description: "The address to listen for TCP connections on."
required: true
type: string: {
examples: ["0.0.0.0:\(_port)"]
}
}
connection_limit: {
common: false
description: "The max number of TCP connections that will be processed."
relevant_when: "mode = `tcp`"
required: false
type: uint: {
default: null
unit: "connections"
}
}
}
configuration: base.components.sources.logstash.configuration

output: logs: line: {
description: "A Logstash message"
Expand Down

0 comments on commit 6bcdde7

Please sign in to comment.