diff --git a/src/sinks/humio/logs.rs b/src/sinks/humio/logs.rs index 29e30e8184cd2..8988a227651b9 100644 --- a/src/sinks/humio/logs.rs +++ b/src/sinks/humio/logs.rs @@ -21,7 +21,7 @@ use crate::{ tls::TlsConfig, }; -const HOST: &str = "https://cloud.humio.com"; +pub(super) const HOST: &str = "https://cloud.humio.com"; /// Configuration for the `humio_logs` sink. #[configurable_component(sink("humio_logs"))] @@ -29,11 +29,25 @@ const HOST: &str = "https://cloud.humio.com"; #[serde(deny_unknown_fields)] pub struct HumioLogsConfig { /// The Humio ingestion token. + #[configurable(metadata( + docs::examples = "${HUMIO_TOKEN}", + docs::examples = "A94A8FE5CCB19BA61C4C08" + ))] pub(super) token: SensitiveString, /// The base URL of the Humio instance. + /// + /// The scheme (`http` or `https`) must be specified. No path should be included since the paths defined + /// by the [`Splunk`][splunk] api are used. + /// + /// [splunk]: https://docs.splunk.com/Documentation/Splunk/8.0.0/Data/HECRESTendpoints #[serde(alias = "host")] - pub(super) endpoint: Option, + #[serde(default = "default_endpoint")] + #[configurable(metadata( + docs::examples = "http://127.0.0.1", + docs::examples = "https://example.com", + ))] + pub(super) endpoint: String, /// The source of events sent to this sink. /// @@ -46,6 +60,11 @@ pub struct HumioLogsConfig { /// The type of events sent to this sink. Humio uses this as the name of the parser to use to ingest the data. /// /// If unset, Humio will default it to none. + #[configurable(metadata( + docs::examples = "json", + docs::examples = "none", + docs::examples = "{{ event_type }}" + ))] pub(super) event_type: Option