Skip to content

Commit

Permalink
docker_logs use override host key (#6395)
Browse files Browse the repository at this point in the history
Signed-off-by: drunkirishcoder <[email protected]>
  • Loading branch information
drunkirishcoder authored Feb 12, 2021
1 parent ec7dda6 commit 0915677
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/sources/docker_logs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::util::MultilineConfig;
use crate::{
config::{log_schema, DataType, GlobalOptions, LogSchema, SourceConfig, SourceDescription},
config::{log_schema, DataType, GlobalOptions, SourceConfig, SourceDescription},
event::merge_state::LogEventMergeState,
event::{self, Event, LogEvent, Value},
internal_events::{
Expand Down Expand Up @@ -63,7 +63,7 @@ enum Error {
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields, default)]
pub struct DockerLogsConfig {
#[serde(default = "LogSchema::default_host_key")]
#[serde(default = "default_host_key")]
host_key: String,
docker_host: Option<String>,
tls: Option<DockerTlsConfig>,
Expand All @@ -88,7 +88,7 @@ pub struct DockerTlsConfig {
impl Default for DockerLogsConfig {
fn default() -> Self {
Self {
host_key: LogSchema::default_host_key(),
host_key: default_host_key(),
docker_host: None,
tls: None,
exclude_containers: None,
Expand All @@ -103,6 +103,10 @@ impl Default for DockerLogsConfig {
}
}

fn default_host_key() -> String {
log_schema().host_key().to_string()
}

impl DockerLogsConfig {
fn container_name_or_id_included<'a>(
&self,
Expand Down

0 comments on commit 0915677

Please sign in to comment.