diff --git a/src/sinks/influxdb/logs.rs b/src/sinks/influxdb/logs.rs index 5e8f5b33dc6e8a..50203e264dba07 100644 --- a/src/sinks/influxdb/logs.rs +++ b/src/sinks/influxdb/logs.rs @@ -281,11 +281,8 @@ impl HttpEventEncoder for InfluxDbLogsEncoder { if let Some(source_type_path) = log.source_type_path() { self.tags.replace(source_type_path); - } - - if let Some(source_type_key) = log_schema().source_type_key() { log.rename_key( - (PathPrefix::Event, source_type_key), + (PathPrefix::Event, source_type_path), (PathPrefix::Event, &self.source_type_key), ); } diff --git a/src/sources/http_server.rs b/src/sources/http_server.rs index 1ad581b0d7136b..cadd154fc87954 100644 --- a/src/sources/http_server.rs +++ b/src/sources/http_server.rs @@ -964,7 +964,9 @@ mod tests { lookup::PathPrefix::Event, log_schema().source_type_key().unwrap(), )) - .unwrap().as_str().unwrap(); + .unwrap() + .as_str() + .unwrap(); assert_eq!(source_type_key_value, SimpleHttpConfig::NAME); assert_eq!(log["http_path"], "/".into()); }