mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-10 20:05:55 +02:00
up
This commit is contained in:
parent
19191a6b32
commit
5b774c3a3e
1 changed files with 22 additions and 0 deletions
|
@ -243,3 +243,25 @@ func (w MatchedRules) ByAccuracy(accuracy string) MatchedRules {
|
|||
log.Debugf("ByAccuracy(%s) -> %d", accuracy, len(ret))
|
||||
return ret
|
||||
}
|
||||
|
||||
func (w MatchedRules) ByName(name string) MatchedRules {
|
||||
ret := MatchedRules{}
|
||||
for _, rule := range w {
|
||||
if rule["name"] == name {
|
||||
ret = append(ret, rule)
|
||||
}
|
||||
}
|
||||
log.Debugf("ByName(%s) -> %d", name, len(ret))
|
||||
return ret
|
||||
}
|
||||
|
||||
func (w MatchedRules) ByMsg(msg string) MatchedRules {
|
||||
ret := MatchedRules{}
|
||||
for _, rule := range w {
|
||||
if rule["msg"] == msg {
|
||||
ret = append(ret, rule)
|
||||
}
|
||||
}
|
||||
log.Debugf("ByMsg(%s) -> %d", msg, len(ret))
|
||||
return ret
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue