From 9b7d70aa1ab1665d60942a696edfedbcd56a3985 Mon Sep 17 00:00:00 2001 From: chrismark Date: Tue, 12 Nov 2019 16:13:48 +0200 Subject: [PATCH 1/2] Add light modules of oss as source in docs collector Signed-off-by: chrismark --- metricbeat/scripts/msetlists/cmd/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/metricbeat/scripts/msetlists/cmd/main.go b/metricbeat/scripts/msetlists/cmd/main.go index 91bc2a3dd71..02376ec8c80 100644 --- a/metricbeat/scripts/msetlists/cmd/main.go +++ b/metricbeat/scripts/msetlists/cmd/main.go @@ -22,11 +22,21 @@ import ( "fmt" "os" + "github.com/elastic/beats/libbeat/paths" + "github.com/elastic/beats/metricbeat/mb" + _ "github.com/elastic/beats/metricbeat/include" "github.com/elastic/beats/metricbeat/scripts/msetlists" ) func main() { + // Disable permission checks so it reads light modules in any case + os.Setenv("BEAT_STRICT_PERMS", "false") + + path := paths.Resolve(paths.Home, "../metricbeat/module") + lm := mb.NewLightModulesSource(path) + mb.Registry.SetSecondarySource(lm) + msList := msetlists.DefaultMetricsets() raw, err := json.MarshalIndent(msList, "", " ") From 5eeb3c3b266566666e96a5d9d00419560bc7a3a7 Mon Sep 17 00:00:00 2001 From: chrismark Date: Wed, 13 Nov 2019 15:12:00 +0200 Subject: [PATCH 2/2] Remove empty line and fmt Signed-off-by: chrismark --- metricbeat/scripts/msetlists/cmd/main.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/metricbeat/scripts/msetlists/cmd/main.go b/metricbeat/scripts/msetlists/cmd/main.go index 02376ec8c80..d964f79b0d2 100644 --- a/metricbeat/scripts/msetlists/cmd/main.go +++ b/metricbeat/scripts/msetlists/cmd/main.go @@ -23,9 +23,8 @@ import ( "os" "github.com/elastic/beats/libbeat/paths" - "github.com/elastic/beats/metricbeat/mb" - _ "github.com/elastic/beats/metricbeat/include" + "github.com/elastic/beats/metricbeat/mb" "github.com/elastic/beats/metricbeat/scripts/msetlists" )