Skip to content

Commit

Permalink
feat(teler): add listen_addr & caller fields in the log
Browse files Browse the repository at this point in the history
Signed-off-by: Dwi Siswanto <git@dw1.io>
  • Loading branch information
dwisiswant0 committed Jun 6, 2024
1 parent 3e05be2 commit e63f546
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions teler.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ func (t *Teler) sendLogs(r *http.Request, k threat.Threat, id string, msg string
cat := k.String()
path := r.URL.String()
ipAddr := t.env.GetRequestValue("IP")
listenAddr := t.getListenAddr(r)

// Log the detected threat, request details and the error message.
t.log.With(
Expand All @@ -403,6 +404,8 @@ func (t *Teler) sendLogs(r *http.Request, k threat.Threat, id string, msg string
zap.String("ip_addr", ipAddr),
zap.Any("headers", r.Header),
zap.String("body", body),
zap.String("listen_addr", listenAddr),
zap.String("caller", t.caller),
).Warn(msg)

if t.opt.FalcoSidekickURL == "" {
Expand Down

0 comments on commit e63f546

Please sign in to comment.