From 7d459f7d3b3f62ef96b6853bef111b893eec6a2d Mon Sep 17 00:00:00 2001 From: Pier-Hugues Pellerin Date: Mon, 5 Jul 2021 13:19:04 -0400 Subject: [PATCH] Reduce the verbosity of the debug log for monitoring (#26583) * Reduce the verbosity of the debug log for monitoring Running Elastic Agent using debug mode would result in leaking credentials for the monitoring of the local logs and metrics. This PR remove the configuration to be exposed via the debug logging statements. We can receive the same information by running the `inspect` subcommand this require access to the local machine and the necessary privileges to read the files. * Changelog * Add PR number, run make check Co-authored-by: michel-laterman (cherry picked from commit c3925fcb5435df6397803542492398da3e8ed484) --- x-pack/elastic-agent/CHANGELOG.next.asciidoc | 1 + x-pack/elastic-agent/pkg/agent/operation/monitoring.go | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/x-pack/elastic-agent/CHANGELOG.next.asciidoc b/x-pack/elastic-agent/CHANGELOG.next.asciidoc index 1e825bcce08..cbc7581b3f7 100644 --- a/x-pack/elastic-agent/CHANGELOG.next.asciidoc +++ b/x-pack/elastic-agent/CHANGELOG.next.asciidoc @@ -73,6 +73,7 @@ - Fix startup with failing configuration {pull}26057[26057] - Change timestamp in elatic-agent-json.log to use UTC {issue}25391[25391] - Fix add support for Logstash output. {pull}24305[24305] +- Do not log Elasticsearch configuration for monitoring output when running with debug. {pull}26583[26583] ==== New features diff --git a/x-pack/elastic-agent/pkg/agent/operation/monitoring.go b/x-pack/elastic-agent/pkg/agent/operation/monitoring.go index 4712759ab70..07491cbd6ab 100644 --- a/x-pack/elastic-agent/pkg/agent/operation/monitoring.go +++ b/x-pack/elastic-agent/pkg/agent/operation/monitoring.go @@ -351,8 +351,6 @@ func (o *Operator) getMonitoringFilebeatConfig(outputType string, output interfa }, } - o.logger.Debugf("monitoring configuration generated for filebeat: %v", result) - return result, true } @@ -585,8 +583,6 @@ func (o *Operator) getMonitoringMetricbeatConfig(outputType string, output inter }, } - o.logger.Debugf("monitoring configuration generated for metricbeat: %v", result) - return result, true }