瀏覽代碼

add debug

alteredCoder 2 年之前
父節點
當前提交
4332598cd1
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      pkg/acquisition/modules/waf/utils.go

+ 3 - 1
pkg/acquisition/modules/waf/utils.go

@@ -10,6 +10,7 @@ import (
 	"github.com/crowdsecurity/crowdsec/pkg/types"
 	"github.com/crowdsecurity/crowdsec/pkg/waf"
 	"github.com/prometheus/client_golang/prometheus"
+	log "github.com/sirupsen/logrus"
 )
 
 func EventFromRequest(r waf.ParsedRequest) (types.Event, error) {
@@ -115,11 +116,12 @@ func (r *WafRunner) AccumulateTxToEvent(tx experimental.FullTransaction, kind st
 		return true
 	})
 
-	r.logger.Infof("variables addr in AccumulateTxToEvent: %p", tx.Variables())
 	//log.Infof("variables: %s", spew.Sdump(tx.Variables()))
 	//log.Infof("tx variables: %+v", tx.Collection(variables.TX))
 	//log.Infof("TX %s", spew.Sdump(tx.MatchedRules()))
+
 	for _, rule := range tx.MatchedRules() {
+		log.Infof("Matched rules ID: %+v", rule.Rule().ID())
 		if rule.Message() == "" {
 			continue
 		}