Skip to content

Commit

Permalink
Remove event fields from error log. (#37330) (#37349)
Browse files Browse the repository at this point in the history
Remove event fields from error log when the script processor
panics. This is an unlikely situation to happen as the Javascript
runtime we use should not panic on any error while executing
Javascript code, hence the event fields are just removed.

(cherry picked from commit 3a504dd)

Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
Co-authored-by: Craig MacKenzie <craig.mackenzie@elastic.co>
  • Loading branch information
3 people authored Dec 12, 2023
1 parent 905cbde commit 331c7b1
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion libbeat/processors/script/javascript/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ func (s *session) runProcessFunc(b *beat.Event) (out *beat.Event, err error) {
if r := recover(); r != nil {
s.log.Errorw("The javascript processor caused an unexpected panic "+
"while processing an event. Recovering, but please report this.",
"event", mapstr.M{"original": b.Fields.String()},
"panic", r,
zap.Stack("stack"))
if !s.evt.IsCancelled() {
Expand Down

0 comments on commit 331c7b1

Please # to comment.