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 415715d)
  • Loading branch information
ph committed Sep 5, 2018
1 parent dcbf650 commit af2efcb
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 af2efcb

Please sign in to comment.