Add error skip logic to action configuration

Updated the action configuration process in server.go to skip an action if its configuration results in an error. This ensures that the remaining actions can still execute, even if one fails during the configuration stage. File action plugin specifically has been updated to support this skip on error logic.
This commit is contained in:
Winni Neessen 2023-12-25 21:08:54 +01:00
parent 670e5b1d30
commit 9089cd80ca
Signed by: wneessen
GPG key ID: 5F3AF39B820C119D

View file

@ -192,6 +192,7 @@ func (s *Server) processMessage(lm parsesyslog.LogMsg) error {
if err := a.Config(r.Actions); err != nil { if err := a.Config(r.Actions); err != nil {
s.log.Error("failed to config action", LogErrKey, err, s.log.Error("failed to config action", LogErrKey, err,
slog.String("action", n), slog.String("rule_id", r.ID)) slog.String("action", n), slog.String("rule_id", r.ID))
continue
} }
if err := a.Process(lm, mg); err != nil { if err := a.Process(lm, mg); err != nil {
s.log.Error("failed to process action", LogErrKey, err, s.log.Error("failed to process action", LogErrKey, err,