Skip to content

Commit

Permalink
Add err check for config file read (elastic#3573)
Browse files Browse the repository at this point in the history
  • Loading branch information
breml authored and monicasarbu committed Feb 10, 2017
1 parent b3a7291 commit d0e20a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion filebeat/config/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package config

import (
"fmt"
"log"
"os"
"path/filepath"
Expand Down Expand Up @@ -89,7 +90,10 @@ func mergeConfigFiles(configFiles []string, config *Config) error {
tmpConfig := struct {
Filebeat Config
}{}
cfgfile.Read(&tmpConfig, file)
err := cfgfile.Read(&tmpConfig, file)
if err != nil {
return fmt.Errorf("Failed to read %s: %s", file, err)
}

config.Prospectors = append(config.Prospectors, tmpConfig.Filebeat.Prospectors...)
}
Expand Down

0 comments on commit d0e20a9

Please sign in to comment.