From 53991416f93025f554c67066d74a88c4a0ade60e Mon Sep 17 00:00:00 2001 From: Tudor Golubenco Date: Wed, 20 Apr 2016 17:58:07 +0200 Subject: [PATCH] If confdir is relative, make it relative to the config path (#1435) This should hopefully be the least surprise for the user. Part of #1417. --- filebeat/config/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/filebeat/config/config.go b/filebeat/config/config.go index ce34ab08debc..f36845637c56 100644 --- a/filebeat/config/config.go +++ b/filebeat/config/config.go @@ -10,6 +10,7 @@ import ( "github.com/elastic/beats/libbeat/cfgfile" "github.com/elastic/beats/libbeat/common" "github.com/elastic/beats/libbeat/logp" + "github.com/elastic/beats/libbeat/paths" ) // Defaults for config variables which are not set @@ -161,6 +162,9 @@ func (config *Config) FetchConfigs() { return } + // If configDir is relative, consider it relative to the config path + configDir = paths.Resolve(paths.Config, configDir) + // Check if optional configDir is set to fetch additional config files logp.Info("Additional config files are fetched from: %s", configDir)