Skip to content

Commit

Permalink
Remove event fields from error log. (#37330)
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)

# Conflicts:
#	libbeat/processors/script/javascript/session.go
  • Loading branch information
belimawr authored and mergify[bot] committed Dec 7, 2023
1 parent 1490a76 commit efce0e2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libbeat/processors/script/javascript/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ 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.",
<<<<<<< HEAD

Check failure on line 212 in libbeat/processors/script/javascript/session.go

View workflow job for this annotation

GitHub Actions / check

syntax error: unexpected <<, expected expression

Check failure on line 212 in libbeat/processors/script/javascript/session.go

View workflow job for this annotation

GitHub Actions / lint (windows)

expected operand, found '<<' (typecheck)

Check failure on line 212 in libbeat/processors/script/javascript/session.go

View workflow job for this annotation

GitHub Actions / lint (linux)

expected operand, found '<<' (typecheck)

Check failure on line 212 in libbeat/processors/script/javascript/session.go

View workflow job for this annotation

GitHub Actions / lint (darwin)

expected operand, found '<<' (typecheck)
"event", common.MapStr{"original": b.Fields.String()},

Check failure on line 213 in libbeat/processors/script/javascript/session.go

View workflow job for this annotation

GitHub Actions / check

syntax error: unexpected comma at end of statement
=======
>>>>>>> 3a504dd1e1 (Remove event fields from error log. (#37330))

Check failure on line 215 in libbeat/processors/script/javascript/session.go

View workflow job for this annotation

GitHub Actions / check

invalid character U+0023 '#'

Check failure on line 215 in libbeat/processors/script/javascript/session.go

View workflow job for this annotation

GitHub Actions / lint (windows)

illegal character U+0023 '#' (typecheck)

Check failure on line 215 in libbeat/processors/script/javascript/session.go

View workflow job for this annotation

GitHub Actions / lint (linux)

illegal character U+0023 '#' (typecheck)

Check failure on line 215 in libbeat/processors/script/javascript/session.go

View workflow job for this annotation

GitHub Actions / lint (darwin)

illegal character U+0023 '#' (typecheck)
"panic", r,
zap.Stack("stack"))

Check failure on line 217 in libbeat/processors/script/javascript/session.go

View workflow job for this annotation

GitHub Actions / check

syntax error: unexpected ), expected := or = or comma
if !s.evt.IsCancelled() {

Check failure on line 218 in libbeat/processors/script/javascript/session.go

View workflow job for this annotation

GitHub Actions / lint (windows)

missing ',' in argument list (typecheck)

Check failure on line 218 in libbeat/processors/script/javascript/session.go

View workflow job for this annotation

GitHub Actions / lint (linux)

missing ',' in argument list (typecheck)

Check failure on line 218 in libbeat/processors/script/javascript/session.go

View workflow job for this annotation

GitHub Actions / lint (darwin)

missing ',' in argument list (typecheck)
Expand Down

0 comments on commit efce0e2

Please # to comment.