diff --git a/metricbeat/docs/modules/logstash.asciidoc b/metricbeat/docs/modules/logstash.asciidoc index 4fd00c867a1f..9d24a100e351 100644 --- a/metricbeat/docs/modules/logstash.asciidoc +++ b/metricbeat/docs/modules/logstash.asciidoc @@ -9,6 +9,7 @@ beta[] This is the Logstash module. +The default metricsets are `node` and `node_stats`. [float] @@ -21,11 +22,7 @@ in <>. Here is an example configuration: ---- metricbeat.modules: - module: logstash - metricsets: ["node", "node_stats"] - enabled: false - period: 10s hosts: ["localhost:9600"] - ---- This module supports TLS connection when using `ssl` config field, as described in <>. diff --git a/metricbeat/metricbeat.reference.yml b/metricbeat/metricbeat.reference.yml index b90f3875cf5a..5464962b5f4a 100644 --- a/metricbeat/metricbeat.reference.yml +++ b/metricbeat/metricbeat.reference.yml @@ -351,11 +351,10 @@ metricbeat.modules: #------------------------------ Logstash Module ------------------------------ - module: logstash metricsets: ["node", "node_stats"] - enabled: false + enabled: true period: 10s hosts: ["localhost:9600"] - #------------------------------ Memcached Module ----------------------------- - module: memcached metricsets: ["stats"] diff --git a/metricbeat/module/logstash/_meta/config.reference.yml b/metricbeat/module/logstash/_meta/config.reference.yml new file mode 100644 index 000000000000..70de278fd698 --- /dev/null +++ b/metricbeat/module/logstash/_meta/config.reference.yml @@ -0,0 +1,5 @@ +- module: logstash + metricsets: ["node", "node_stats"] + enabled: true + period: 10s + hosts: ["localhost:9600"] diff --git a/metricbeat/module/logstash/_meta/config.yml b/metricbeat/module/logstash/_meta/config.yml index 7d1e8fc910ec..73b63b016e10 100644 --- a/metricbeat/module/logstash/_meta/config.yml +++ b/metricbeat/module/logstash/_meta/config.yml @@ -1,6 +1,2 @@ - module: logstash - metricsets: ["node", "node_stats"] - enabled: false - period: 10s hosts: ["localhost:9600"] - diff --git a/metricbeat/module/logstash/_meta/docs.asciidoc b/metricbeat/module/logstash/_meta/docs.asciidoc index 833d3b91d4a3..bddd411d4029 100644 --- a/metricbeat/module/logstash/_meta/docs.asciidoc +++ b/metricbeat/module/logstash/_meta/docs.asciidoc @@ -1,2 +1,3 @@ This is the Logstash module. +The default metricsets are `node` and `node_stats`. diff --git a/metricbeat/module/logstash/node/node.go b/metricbeat/module/logstash/node/node.go index 6079cb87aade..bc6456bad022 100644 --- a/metricbeat/module/logstash/node/node.go +++ b/metricbeat/module/logstash/node/node.go @@ -11,9 +11,10 @@ import ( // init registers the MetricSet with the central registry. // The New method will be called after the setup of the module and before starting to fetch data func init() { - if err := mb.Registry.AddMetricSet("logstash", "node", New, hostParser); err != nil { - panic(err) - } + mb.Registry.MustAddMetricSet("logstash", "node", New, + mb.WithHostParser(hostParser), + mb.DefaultMetricSet(), + ) } var ( diff --git a/metricbeat/module/logstash/node_stats/node_stats.go b/metricbeat/module/logstash/node_stats/node_stats.go index 9346a6000296..54d119a1f34a 100644 --- a/metricbeat/module/logstash/node_stats/node_stats.go +++ b/metricbeat/module/logstash/node_stats/node_stats.go @@ -20,6 +20,7 @@ func init() { mb.Registry.MustAddMetricSet(moduleName, metricsetName, New, mb.WithHostParser(hostParser), mb.WithNamespace(namespace), + mb.DefaultMetricSet(), ) } diff --git a/metricbeat/modules.d/logstash.yml.disabled b/metricbeat/modules.d/logstash.yml.disabled index 7d1e8fc910ec..73b63b016e10 100644 --- a/metricbeat/modules.d/logstash.yml.disabled +++ b/metricbeat/modules.d/logstash.yml.disabled @@ -1,6 +1,2 @@ - module: logstash - metricsets: ["node", "node_stats"] - enabled: false - period: 10s hosts: ["localhost:9600"] -