Skip to content

Commit

Permalink
Add custom unpack to log hints config to avoid env resolution (#7710)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjsamuel authored and exekias committed Jul 30, 2018
1 parent 91af9a7 commit 80f5efc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ https://github.com/elastic/beats/compare/v6.4.0...master[Check the HEAD diff]

*Filebeat*

- Add custom unpack to log hints config to avoid env resolution {pull}7710[7710]

*Heartbeat*

*Metricbeat*
Expand Down
18 changes: 18 additions & 0 deletions filebeat/autodiscover/builder/hints/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,21 @@ func defaultConfig() config {
Config: cfg,
}
}

func (c *config) Unpack(from *common.Config) error {
tmpConfig := struct {
Key string `config:"key"`
}{
Key: c.Key,
}
if err := from.Unpack(&tmpConfig); err != nil {
return err
}

if config, err := from.Child("config", -1); err == nil {
c.Config = config
}

c.Key = tmpConfig.Key
return nil
}

0 comments on commit 80f5efc

Please sign in to comment.