From d508aef7e5ca0149ea094aa7048178d8ce622f06 Mon Sep 17 00:00:00 2001 From: ulricqin Date: Tue, 12 Jul 2022 16:39:23 +0800 Subject: [PATCH] fix mute: parse regexp (#1044) --- src/models/alert_mute.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/alert_mute.go b/src/models/alert_mute.go index 70a242d5..157c9289 100644 --- a/src/models/alert_mute.go +++ b/src/models/alert_mute.go @@ -88,12 +88,12 @@ func (m *AlertMute) Parse() error { } for i := 0; i < len(m.ITags); i++ { - if m.ITags[i].Func == "=~" { + if m.ITags[i].Func == "=~" || m.ITags[i].Func == "!~" { m.ITags[i].Regexp, err = regexp.Compile(m.ITags[i].Value) if err != nil { return err } - } else if m.ITags[i].Func == "in" { + } else if m.ITags[i].Func == "in" || m.ITags[i].Func == "not in" { arr := strings.Fields(m.ITags[i].Value) m.ITags[i].Vset = make(map[string]struct{}) for j := 0; j < len(arr); j++ {