From f06a2e80276265112b2eb797bb4dd7b59e577107 Mon Sep 17 00:00:00 2001 From: Marco Pfatschbacher Date: Fri, 21 Sep 2018 09:01:28 +0200 Subject: [PATCH] Update filebeat and winlogbeat to 6.4.1 Our bundled filebeat had a memory leak (elastic/beats#6797). Fixes #283 While here: The "-configtest" option is deprecated since Beats 6.0. Add a version switch to avoid warning. --- backends/beats/filebeat/render.go | 8 +++++++- backends/beats/winlogbeat/render.go | 8 +++++++- dist/fetch_collectors.sh | 4 ++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/backends/beats/filebeat/render.go b/backends/beats/filebeat/render.go index 61c3b11..06064a4 100644 --- a/backends/beats/filebeat/render.go +++ b/backends/beats/filebeat/render.go @@ -199,7 +199,13 @@ func (fbc *FileBeatConfig) RenderOnChange(response graylog.ResponseCollectorConf } func (fbc *FileBeatConfig) ValidateConfigurationFile() bool { - output, err := exec.Command(fbc.ExecPath(), "-configtest", "-c", fbc.ConfigurationPath()).CombinedOutput() + var output []byte + var err error + if fbc.Beats.Version[0] >= 6 { + output, err = exec.Command(fbc.ExecPath(), "test", "config", "-c", fbc.ConfigurationPath()).CombinedOutput() + } else { + output, err = exec.Command(fbc.ExecPath(), "-configtest", "-c", fbc.ConfigurationPath()).CombinedOutput() + } soutput := string(output) if err != nil { log.Errorf("[%s] Error during configuration validation: %s", fbc.Name(), soutput) diff --git a/backends/beats/winlogbeat/render.go b/backends/beats/winlogbeat/render.go index 79f1122..0a398a6 100644 --- a/backends/beats/winlogbeat/render.go +++ b/backends/beats/winlogbeat/render.go @@ -156,7 +156,13 @@ func (wlbc *WinLogBeatConfig) RenderOnChange(response graylog.ResponseCollectorC } func (wlbc *WinLogBeatConfig) ValidateConfigurationFile() bool { - output, err := exec.Command(wlbc.ExecPath(), "-configtest", "-c", wlbc.ConfigurationPath()).CombinedOutput() + var output []byte + var err error + if wlbc.Beats.Version[0] >= 6 { + output, err = exec.Command(wlbc.ExecPath(), "test", "config", "-c", wlbc.ConfigurationPath()).CombinedOutput() + } else { + output, err = exec.Command(wlbc.ExecPath(), "-configtest", "-c", wlbc.ConfigurationPath()).CombinedOutput() + } soutput := string(output) if err != nil { log.Errorf("[%s] Error during configuration validation: %s", wlbc.Name(), soutput) diff --git a/dist/fetch_collectors.sh b/dist/fetch_collectors.sh index 254b34a..b284202 100755 --- a/dist/fetch_collectors.sh +++ b/dist/fetch_collectors.sh @@ -1,8 +1,8 @@ #!/bin/bash ARCHS=( x86 x86_64 ) -FILEBEAT_VERSION=6.1.2 -WINLOGBEAT_VERSION=6.1.2 +FILEBEAT_VERSION=6.4.1 +WINLOGBEAT_VERSION=6.4.1 # $1: beat name # $2: beat operating system