From 36788d13bd9f87c480c47677d0ca5f2ba400d743 Mon Sep 17 00:00:00 2001 From: Jesse Szwedko Date: Tue, 1 Aug 2023 08:49:03 -0700 Subject: [PATCH] fix(codecs): Move protobuf codec options under a `protobuf` key (#18111) Follow up to https://github.com/vectordotdev/vector/pull/18019#discussion_r1278192502 The option "namespacing" is per: https://github.com/vectordotdev/vector/blob/master/docs/specs/configuration.md#polymorphism Signed-off-by: Jesse Szwedko --- lib/codecs/src/decoding/format/protobuf.rs | 28 +++++++++++++----- .../components/sources/base/amqp.cue | 29 +++++++++++-------- .../sources/base/aws_kinesis_firehose.cue | 29 +++++++++++-------- .../components/sources/base/aws_s3.cue | 29 +++++++++++-------- .../components/sources/base/aws_sqs.cue | 29 +++++++++++-------- .../components/sources/base/datadog_agent.cue | 29 +++++++++++-------- .../components/sources/base/demo_logs.cue | 29 +++++++++++-------- .../components/sources/base/exec.cue | 29 +++++++++++-------- .../sources/base/file_descriptor.cue | 29 +++++++++++-------- .../components/sources/base/gcp_pubsub.cue | 29 +++++++++++-------- .../components/sources/base/heroku_logs.cue | 29 +++++++++++-------- .../components/sources/base/http.cue | 29 +++++++++++-------- .../components/sources/base/http_client.cue | 29 +++++++++++-------- .../components/sources/base/http_server.cue | 29 +++++++++++-------- .../components/sources/base/kafka.cue | 29 +++++++++++-------- .../components/sources/base/nats.cue | 29 +++++++++++-------- .../components/sources/base/redis.cue | 29 +++++++++++-------- .../components/sources/base/socket.cue | 29 +++++++++++-------- .../components/sources/base/stdin.cue | 29 +++++++++++-------- 19 files changed, 327 insertions(+), 223 deletions(-) diff --git a/lib/codecs/src/decoding/format/protobuf.rs b/lib/codecs/src/decoding/format/protobuf.rs index c2b14310a17dc..ff337a18f6fe8 100644 --- a/lib/codecs/src/decoding/format/protobuf.rs +++ b/lib/codecs/src/decoding/format/protobuf.rs @@ -4,6 +4,7 @@ use std::path::PathBuf; use bytes::Bytes; use chrono::Utc; +use derivative::Derivative; use ordered_float::NotNan; use prost_reflect::{DescriptorPool, DynamicMessage, MessageDescriptor, ReflectMessage}; use smallvec::{smallvec, SmallVec}; @@ -22,11 +23,12 @@ use super::Deserializer; #[configurable_component] #[derive(Debug, Clone, Default)] pub struct ProtobufDeserializerConfig { - /// Path to desc file - desc_file: PathBuf, - - /// message type. e.g package.message - message_type: String, + /// Protobuf-specific decoding options. + #[serde( + default, + skip_serializing_if = "vector_core::serde::skip_serializing_if_default" + )] + pub protobuf: ProtobufDeserializerOptions, } impl ProtobufDeserializerConfig { @@ -66,6 +68,18 @@ impl ProtobufDeserializerConfig { } } +/// Protobuf-specific decoding options. +#[configurable_component] +#[derive(Debug, Clone, PartialEq, Eq, Derivative)] +#[derivative(Default)] +pub struct ProtobufDeserializerOptions { + /// Path to desc file + desc_file: PathBuf, + + /// message type. e.g package.message + message_type: String, +} + /// Deserializer that builds `Event`s from a byte frame containing protobuf. #[derive(Debug, Clone)] pub struct ProtobufDeserializer { @@ -125,8 +139,8 @@ impl TryFrom<&ProtobufDeserializerConfig> for ProtobufDeserializer { type Error = vector_common::Error; fn try_from(config: &ProtobufDeserializerConfig) -> vector_common::Result { let message_descriptor = ProtobufDeserializer::get_message_descriptor( - &config.desc_file, - config.message_type.clone(), + &config.protobuf.desc_file, + config.protobuf.message_type.clone(), )?; Ok(Self::new(message_descriptor)) } diff --git a/website/cue/reference/components/sources/base/amqp.cue b/website/cue/reference/components/sources/base/amqp.cue index 5dca16763beee..8100c736a7c46 100644 --- a/website/cue/reference/components/sources/base/amqp.cue +++ b/website/cue/reference/components/sources/base/amqp.cue @@ -100,12 +100,6 @@ base: components: sources: amqp: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -138,12 +132,6 @@ base: components: sources: amqp: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -160,6 +148,23 @@ base: components: sources: amqp: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/aws_kinesis_firehose.cue b/website/cue/reference/components/sources/base/aws_kinesis_firehose.cue index abc1d6106fc4f..eb7af974c2350 100644 --- a/website/cue/reference/components/sources/base/aws_kinesis_firehose.cue +++ b/website/cue/reference/components/sources/base/aws_kinesis_firehose.cue @@ -103,12 +103,6 @@ base: components: sources: aws_kinesis_firehose: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -141,12 +135,6 @@ base: components: sources: aws_kinesis_firehose: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -163,6 +151,23 @@ base: components: sources: aws_kinesis_firehose: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/aws_s3.cue b/website/cue/reference/components/sources/base/aws_s3.cue index c382a52257f67..ee9e3adcee02f 100644 --- a/website/cue/reference/components/sources/base/aws_s3.cue +++ b/website/cue/reference/components/sources/base/aws_s3.cue @@ -198,12 +198,6 @@ base: components: sources: aws_s3: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -236,12 +230,6 @@ base: components: sources: aws_s3: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -258,6 +246,23 @@ base: components: sources: aws_s3: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/aws_sqs.cue b/website/cue/reference/components/sources/base/aws_sqs.cue index c9f69ce7b493d..aae7840898789 100644 --- a/website/cue/reference/components/sources/base/aws_sqs.cue +++ b/website/cue/reference/components/sources/base/aws_sqs.cue @@ -193,12 +193,6 @@ base: components: sources: aws_sqs: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -231,12 +225,6 @@ base: components: sources: aws_sqs: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -253,6 +241,23 @@ base: components: sources: aws_sqs: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/datadog_agent.cue b/website/cue/reference/components/sources/base/datadog_agent.cue index c4650c18517fb..eafd6916cc374 100644 --- a/website/cue/reference/components/sources/base/datadog_agent.cue +++ b/website/cue/reference/components/sources/base/datadog_agent.cue @@ -85,12 +85,6 @@ base: components: sources: datadog_agent: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -123,12 +117,6 @@ base: components: sources: datadog_agent: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -145,6 +133,23 @@ base: components: sources: datadog_agent: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/demo_logs.cue b/website/cue/reference/components/sources/base/demo_logs.cue index 80d67e4a3071c..e57db31371b89 100644 --- a/website/cue/reference/components/sources/base/demo_logs.cue +++ b/website/cue/reference/components/sources/base/demo_logs.cue @@ -64,12 +64,6 @@ base: components: sources: demo_logs: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -102,12 +96,6 @@ base: components: sources: demo_logs: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -124,6 +112,23 @@ base: components: sources: demo_logs: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/exec.cue b/website/cue/reference/components/sources/base/exec.cue index fe9857a6626ae..5842254670c91 100644 --- a/website/cue/reference/components/sources/base/exec.cue +++ b/website/cue/reference/components/sources/base/exec.cue @@ -60,12 +60,6 @@ base: components: sources: exec: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -98,12 +92,6 @@ base: components: sources: exec: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -120,6 +108,23 @@ base: components: sources: exec: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/file_descriptor.cue b/website/cue/reference/components/sources/base/file_descriptor.cue index 4c65fd3d0dbed..7a98e6e531d46 100644 --- a/website/cue/reference/components/sources/base/file_descriptor.cue +++ b/website/cue/reference/components/sources/base/file_descriptor.cue @@ -55,12 +55,6 @@ base: components: sources: file_descriptor: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -93,12 +87,6 @@ base: components: sources: file_descriptor: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -115,6 +103,23 @@ base: components: sources: file_descriptor: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/gcp_pubsub.cue b/website/cue/reference/components/sources/base/gcp_pubsub.cue index 73bc51dbb2f83..b1a87f22af305 100644 --- a/website/cue/reference/components/sources/base/gcp_pubsub.cue +++ b/website/cue/reference/components/sources/base/gcp_pubsub.cue @@ -131,12 +131,6 @@ base: components: sources: gcp_pubsub: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -169,12 +163,6 @@ base: components: sources: gcp_pubsub: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -191,6 +179,23 @@ base: components: sources: gcp_pubsub: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/heroku_logs.cue b/website/cue/reference/components/sources/base/heroku_logs.cue index e5eab4e11a1e6..b08134e07dee5 100644 --- a/website/cue/reference/components/sources/base/heroku_logs.cue +++ b/website/cue/reference/components/sources/base/heroku_logs.cue @@ -97,12 +97,6 @@ base: components: sources: heroku_logs: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -135,12 +129,6 @@ base: components: sources: heroku_logs: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -157,6 +145,23 @@ base: components: sources: heroku_logs: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/http.cue b/website/cue/reference/components/sources/base/http.cue index e031e1df64760..21671e40afd90 100644 --- a/website/cue/reference/components/sources/base/http.cue +++ b/website/cue/reference/components/sources/base/http.cue @@ -98,12 +98,6 @@ base: components: sources: http: configuration: { """ } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -136,12 +130,6 @@ base: components: sources: http: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -158,6 +146,23 @@ base: components: sources: http: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/http_client.cue b/website/cue/reference/components/sources/base/http_client.cue index d84f7f43839c7..eb2df43a013d4 100644 --- a/website/cue/reference/components/sources/base/http_client.cue +++ b/website/cue/reference/components/sources/base/http_client.cue @@ -97,12 +97,6 @@ base: components: sources: http_client: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -135,12 +129,6 @@ base: components: sources: http_client: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -157,6 +145,23 @@ base: components: sources: http_client: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/http_server.cue b/website/cue/reference/components/sources/base/http_server.cue index 5341bea4c3d3f..6ee325a66a02c 100644 --- a/website/cue/reference/components/sources/base/http_server.cue +++ b/website/cue/reference/components/sources/base/http_server.cue @@ -98,12 +98,6 @@ base: components: sources: http_server: configuration: { """ } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -136,12 +130,6 @@ base: components: sources: http_server: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -158,6 +146,23 @@ base: components: sources: http_server: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/kafka.cue b/website/cue/reference/components/sources/base/kafka.cue index 1791dc5500856..3834952d75297 100644 --- a/website/cue/reference/components/sources/base/kafka.cue +++ b/website/cue/reference/components/sources/base/kafka.cue @@ -109,12 +109,6 @@ base: components: sources: kafka: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -147,12 +141,6 @@ base: components: sources: kafka: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -169,6 +157,23 @@ base: components: sources: kafka: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/nats.cue b/website/cue/reference/components/sources/base/nats.cue index 3620382321118..90c5395bee521 100644 --- a/website/cue/reference/components/sources/base/nats.cue +++ b/website/cue/reference/components/sources/base/nats.cue @@ -152,12 +152,6 @@ base: components: sources: nats: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -190,12 +184,6 @@ base: components: sources: nats: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -212,6 +200,23 @@ base: components: sources: nats: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/redis.cue b/website/cue/reference/components/sources/base/redis.cue index 11e4cb69b2d40..f43534be91d58 100644 --- a/website/cue/reference/components/sources/base/redis.cue +++ b/website/cue/reference/components/sources/base/redis.cue @@ -70,12 +70,6 @@ base: components: sources: redis: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -108,12 +102,6 @@ base: components: sources: redis: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -130,6 +118,23 @@ base: components: sources: redis: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/socket.cue b/website/cue/reference/components/sources/base/socket.cue index 044035db0b789..331327f19253e 100644 --- a/website/cue/reference/components/sources/base/socket.cue +++ b/website/cue/reference/components/sources/base/socket.cue @@ -72,12 +72,6 @@ base: components: sources: socket: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -110,12 +104,6 @@ base: components: sources: socket: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -132,6 +120,23 @@ base: components: sources: socket: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\"" diff --git a/website/cue/reference/components/sources/base/stdin.cue b/website/cue/reference/components/sources/base/stdin.cue index bf388e17c605d..84d030db05a6f 100644 --- a/website/cue/reference/components/sources/base/stdin.cue +++ b/website/cue/reference/components/sources/base/stdin.cue @@ -55,12 +55,6 @@ base: components: sources: stdin: configuration: { } } } - desc_file: { - description: "Path to desc file" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } gelf: { description: "GELF-specific decoding options." relevant_when: "codec = \"gelf\"" @@ -93,12 +87,6 @@ base: components: sources: stdin: configuration: { type: bool: default: true } } - message_type: { - description: "message type. e.g package.message" - relevant_when: "codec = \"protobuf\"" - required: true - type: string: {} - } native_json: { description: "Vector's native JSON-specific decoding options." relevant_when: "codec = \"native_json\"" @@ -115,6 +103,23 @@ base: components: sources: stdin: configuration: { type: bool: default: true } } + protobuf: { + description: "Protobuf-specific decoding options." + relevant_when: "codec = \"protobuf\"" + required: false + type: object: options: { + desc_file: { + description: "Path to desc file" + required: false + type: string: default: "" + } + message_type: { + description: "message type. e.g package.message" + required: false + type: string: default: "" + } + } + } syslog: { description: "Syslog-specific decoding options." relevant_when: "codec = \"syslog\""