diff --git a/src/meta_plugin/hostname.rs b/src/meta_plugin/hostname.rs index 3555044..2f24986 100644 --- a/src/meta_plugin/hostname.rs +++ b/src/meta_plugin/hostname.rs @@ -264,15 +264,33 @@ impl MetaPlugin for HostnameMetaPlugin { // Prepare metadata to return let mut metadata = Vec::new(); - // Add enabled metadata to the response + // Add enabled metadata to the response using process_metadata_outputs if hostname_enabled { - metadata.push(("hostname".to_string(), serde_yaml::Value::String(hostname_value.clone()))); + if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs( + "hostname", + serde_yaml::Value::String(hostname_value.clone()), + &self.outputs + ) { + metadata.push(meta_data); + } } if hostname_full_enabled { - metadata.push(("hostname_full".to_string(), serde_yaml::Value::String(full_hostname.clone()))); + if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs( + "hostname_full", + serde_yaml::Value::String(full_hostname.clone()), + &self.outputs + ) { + metadata.push(meta_data); + } } if hostname_short_enabled { - metadata.push(("hostname_short".to_string(), serde_yaml::Value::String(short_hostname.clone()))); + if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs( + "hostname_short", + serde_yaml::Value::String(short_hostname.clone()), + &self.outputs + ) { + metadata.push(meta_data); + } } // Update outputs based on enabled status