@@ -59,7 +59,7 @@ func (c *classicalStrategy) Insert(rule string) {
59
59
60
60
r , err := c .parse (ruleType , rule , "" , params )
61
61
if err != nil {
62
- log .Warnln ("parse rule error:[%s] " , err .Error ())
62
+ log .Warnln ("parse classical rule error: %s " , err .Error ())
63
63
} else {
64
64
if r .ShouldResolveIP () {
65
65
c .shouldResolveIP = true
@@ -83,7 +83,7 @@ func ruleParse(ruleRaw string) (string, string, []string) {
83
83
return item [0 ], item [1 ], nil
84
84
} else if len (item ) > 2 {
85
85
if item [0 ] == "NOT" || item [0 ] == "OR" || item [0 ] == "AND" || item [0 ] == "SUB-RULE" || item [0 ] == "DOMAIN-REGEX" || item [0 ] == "PROCESS-NAME-REGEX" || item [0 ] == "PROCESS-PATH-REGEX" {
86
- return item [0 ], strings .Join (item [1 :len ( item ) ], "," ), nil
86
+ return item [0 ], strings .Join (item [1 :], "," ), nil
87
87
} else {
88
88
return item [0 ], item [1 ], item [2 :]
89
89
}
@@ -95,8 +95,8 @@ func ruleParse(ruleRaw string) (string, string, []string) {
95
95
func NewClassicalStrategy (parse func (tp , payload , target string , params []string , subRules map [string ][]C.Rule ) (parsed C.Rule , parseErr error )) * classicalStrategy {
96
96
return & classicalStrategy {rules : []C.Rule {}, parse : func (tp , payload , target string , params []string ) (parsed C.Rule , parseErr error ) {
97
97
switch tp {
98
- case "MATCH" :
99
- return nil , fmt .Errorf ("unsupported rule type on rule-set" )
98
+ case "MATCH" , "RULE-SET" , "SUB-RULE" :
99
+ return nil , fmt .Errorf ("unsupported rule type on classical rule-set: %s" , tp )
100
100
default :
101
101
return parse (tp , payload , target , params , nil )
102
102
}
0 commit comments