Skip to content

re

Input Stack:
value: String
key: String
Output Stack:
(key=~/^value/): Query
 

Warning

Regular expressions can be expensive to check and should be avoided if possible. When designing data to publish ensure that common query patterns would not need the use of regular expressions.

Select time series where the value for a key matches the specified regular expression. The regular expression value will be automatically anchored at the start and the matching is case sensitive. Always try to have a simple prefix on the expression to allow for more efficient matching of the expression.

Parameters

  • key: The tag key to match against (e.g., name, nf.app)
  • value: A regular expression pattern to match against the key's value (case-sensitive)

Examples

Case-sensitive regex matching with a prefix pattern:

name,ssCpu,:re

When matching against the sample data in the table below, the highlighted time series would be included in the result set:

Namenf.appnf.node
ssCpuUser alerttest i-0123
ssCpuSystem alerttest i-0123
ssCpuUser nccp i-0abc
ssCpuSystem nccp i-0abc
numRequests nccp i-0abc
ssCpuUser api i-0456
  • :eq - Exact string matching (much faster)
  • :reic - Case-insensitive regular expression matching
  • :in - Match against a list of possible values
  • :has - Check if a tag key exists regardless of value

See Also

For more information on supported patterns, see the Java regular expressions documentation.