From 69cd8d89dfebec5410746e086fe0c772f58d2662 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Wed, 12 Feb 2020 05:59:25 -0800 Subject: [PATCH] Omit monitoring object from logstash_stats.logstash object (#16198) * Omit monitoring object from logstash_stats.logstash object * Removing unnecessary struct tag info * Adding CHANGELOG entry * Adding explanatory comment for nodeInfo --- CHANGELOG.next.asciidoc | 1 + metricbeat/module/logstash/node_stats/data_xpack.go | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 3bae809bc2e..b398ee329e7 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -88,6 +88,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Add dedot for cloudwatch metric name. {issue}15916[15916] {pull}15917[15917] - Fixed issue `logstash-xpack` module suddenly ceasing to monitor Logstash. {issue}15974[15974] {pull}16044[16044] - Fix skipping protocol scheme by light modules. {pull}16205[pull] +- Made `logstash-xpack` module once again have parity with internally-collected Logstash monitoring data. {pull}16198[16198] *Packetbeat* diff --git a/metricbeat/module/logstash/node_stats/data_xpack.go b/metricbeat/module/logstash/node_stats/data_xpack.go index 4d9e071f400..442bf43ebf2 100644 --- a/metricbeat/module/logstash/node_stats/data_xpack.go +++ b/metricbeat/module/logstash/node_stats/data_xpack.go @@ -96,7 +96,14 @@ type nodeInfo struct { Status string `json:"status"` HTTPAddress string `json:"http_address"` Pipeline pipeline `json:"pipeline"` - Monitoring struct { +} + +// inNodeInfo represents the Logstash node info to be parsed from the Logstash API +// response. It contains nodeInfo (which is also used as-is elsewhere) + monitoring +// information. +type inNodeInfo struct { + nodeInfo + Monitoring struct { ClusterID string `json:"cluster_uuid"` } `json:"monitoring"` } @@ -108,7 +115,7 @@ type reloads struct { // NodeStats represents the stats of a Logstash node type NodeStats struct { - nodeInfo + inNodeInfo commonStats Process process `json:"process"` OS os `json:"os"`