Skip to content

Commit

Permalink
Fix a race condition with the add_host_metadata processor (elastic#8223)
Browse files Browse the repository at this point in the history
Fix a race between updating the host data structure and the
serialization of events to json.

closes elastic#8040

(cherry picked from commit 415715d)
  • Loading branch information
ph committed Sep 5, 2018
1 parent 38fd590 commit 02340e4
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 02340e4

Please sign in to comment.