Regex Guide

Use Regex to Match Metric Conditions

Regex uses all metrics that contain your input value. Typing aws.elb.httpcode.* would match both aws.elb.httpcode_backend_2xx, as well as

  • Exclude computed metrics using a ^ before the start of a metric name.

  • Use Metric Tags to select a tag to further filter your condition.


We recommend testing any regular expressions that you create at

Match String

Match the start and end of the string contained between ^ and $.

  • Tag Key: ^CloudWisdom$

  • Tag Value: ^true$

Matches the key-value pair CloudWisdom = true

Match Multiple Variables

Match multiple values separated by | between ( ).

  • Tag Key: ^Name$

  • Tag Value: (my-server-one|my-server-two|my-server-three)

Matches any of the following key-value pairs:

  • Name = my-server-one

  • Name = my-server-two

  • Name = my-server-three

Match Wildcard

Match any character(s) using ., which acts as a wildcard.

  • Tag Key: ^Name$

  • Tag Value: .Prod-app-1

Matches any value (e.g., Name = myProd-app-1, Name = yourProd-app-1) as long as Prod-app-1 followed:

Escape Special Regex Characters

Escape special regex characters . * / using a .

  • Tag Key: ^Name$

  • Tag Value:

Matches the key-value pair Name =


For a list of special regex characters you may have to escape, consult this page.

Match Entire Directory

Match an entire website’s directory using .*

  • Matches anything that comes after

  • The Q and E force the URL to be matched literally

Match Part of Directory

Make the URL more specific to match everything from a particular part of the directory.


Matches anything in the

Match Multiple Containers

Match multiple containers between ( ) and separated by |. The following would match any of the following container IDs and exclude them from collection: abcdef123456, 123456abcdef, ghijkl789012.

metrics_blacklist = containers. (abcdef123456|123456abcdef|ghijkl789012)..*

Filter Exclusions

Use a negative lookahead (?!) to specify a group that cannot match after the main expression–if something matches, the result is discarded. The following would match anything but the _all, datastore, and docsindices and exclude them from collection.

Add Filter

Add another index to a negative lookahead by placing the index name between | and $.