Skip to content

Commit 72c6723

Browse files
authored
fix: Improve Monitor Alert condition regexp (#86)
* build: Bump required Go version to 1.14 * fix: Improve Monitor Alert condition regexp
1 parent 9d189c5 commit 72c6723

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sysdig/resource_sysdig_monitor_alert_event.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func eventAlertFromResourceData(data *schema.ResourceData) (alert *monitor.Alert
171171
}
172172

173173
// https://regex101.com/r/mmpz0D/1
174-
var alertConditionRegex = regexp.MustCompile(`count\(customEvent\)\s?(?P<rel>[^\w])\s?(?P<count>\d+)`)
174+
var alertConditionRegex = regexp.MustCompile(`count\(customEvent\)\s*(?P<rel>[^\w\s]+)\s*(?P<count>\d+)`)
175175

176176
func eventAlertToResourceData(alert *monitor.Alert, data *schema.ResourceData) (err error) {
177177
err = alertToResourceData(alert, data)

0 commit comments

Comments
 (0)