Skip to content

Commit

Permalink
Fix fields.yml lookup when using export template with a custom `p…
Browse files Browse the repository at this point in the history
…ath.config` param (elastic#5091)

Fixes elastic#5089
  • Loading branch information
exekias authored and ruflin committed Sep 5, 2017
1 parent 48238e1 commit 16ce368
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di
- Add support for `initContainers` in `add_kubernetes_metadata` processor. {issue}4825[4825]
- Fix the `/usr/bin/beatname` script to accept `-d "*"` as a parameter. {issue}5040[5040]
- Combine `fields.yml` properties when they are defined in different sources. {issue}5075[5075]
- Fix `fields.yml` lookup when using `export template` with a custom `path.config` param. {issue}5089[5089]

*Auditbeat*

Expand Down
4 changes: 3 additions & 1 deletion libbeat/cmd/export/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/spf13/cobra"

"github.com/elastic/beats/libbeat/cmd/instance"
"github.com/elastic/beats/libbeat/paths"
"github.com/elastic/beats/libbeat/template"
)

Expand Down Expand Up @@ -44,7 +45,8 @@ func GenTemplateConfigCmd(name, beatVersion string) *cobra.Command {
os.Exit(1)
}

templateString, err := tmpl.Load(cfg.Fields)
fieldsPath := paths.Resolve(paths.Config, cfg.Fields)
templateString, err := tmpl.Load(fieldsPath)
if err != nil {
fmt.Fprintf(os.Stderr, "Error generating template: %+v", err)
os.Exit(1)
Expand Down

0 comments on commit 16ce368

Please sign in to comment.