add debug

This commit is contained in:
alteredCoder 2023-07-31 18:44:32 +02:00
parent 51295ef577
commit 4332598cd1

View file

@ -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
}