Commit 8d53799b by Erik Sundell

stackdriver: always use regex full match for =~ and !=~operator

parent 7e6a5c0a
......@@ -199,7 +199,11 @@ func buildFilterString(metricType string, filterParts []interface{}) string {
if part == "AND" {
filterString += " "
} else if mod == 2 {
if strings.Contains(part.(string), "*") {
operator := filterParts[i-1]
if operator == "=~" || operator == "!=~" {
filterString = reverse(strings.Replace(reverse(filterString), "~", "", 1))
filterString += fmt.Sprintf(`monitoring.regex.full_match("%s")`, part)
} else if strings.Contains(part.(string), "*") {
filterString += interpolateFilterWildcards(part.(string))
} else {
filterString += fmt.Sprintf(`"%s"`, part)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment