Skip to content

Commit

Permalink
Cherry-pick elastic#8223 to 6.3: Fix a race condition with the add_ho…
Browse files Browse the repository at this point in the history
…st_metadata processor (elastic#8237)

Fix a race between updating the host data structure and the
serialization of events to json.

closes elastic#8040

(cherry picked from commit b497720)
  • Loading branch information
ph authored Sep 5, 2018
1 parent 41e5aa2 commit 3cf903d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ https://github.com/elastic/beats/compare/v6.3.2...6.3[Check the HEAD diff]

*Affecting all Beats*

- Fix a race condition with the `add_host_metadata` and the event serialization. {pull}8223[8223]

*Auditbeat*

*Filebeat*
Expand Down
2 changes: 1 addition & 1 deletion libbeat/processors/add_host_metadata/add_host_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func newHostMetadataProcessor(_ *common.Config) (processors.Processor, error) {
// Run enriches the given event with the host meta data
func (p *addHostMetadata) Run(event *beat.Event) (*beat.Event, error) {
p.loadData()
event.Fields.DeepUpdate(p.data)
event.Fields.DeepUpdate(p.data.Clone())
return event, nil
}

Expand Down

0 comments on commit 3cf903d

Please sign in to comment.