Reference to the equals(), equalsIgnoreCase(), and matches() string manipulation functions
Summary
equals(metric|source|<pointTagKey>, "<string>", <tsExpression>)
equalsIgnoreCase(metric|source|<pointTagKey>, "<string>", <tsExpression>)
matches(metric|source|<pointTagKey>, "<stringOrRegex>", <tsExpression>)
The equals()
function returns true if the specified metadata string is equal to the comparison string, and otherwise false. Both strings must match exactly.
The equalsIgnoreCase()
function ignores case, and returns true if the specified metadata string matches the comparison string, and otherwise false. With this function, string
is equal to StRiNg
.
The matches()
function returns true if the specified metadata string matches the comparison string, and false otherwise. The comparison string can be a regular expression.
Parameters
Parameter | Description |
---|---|
metric|source|<pointTagKey> | The metadata string (metric name, source name, or value of a point tag key) to be compared. |
string | The comparison string. |
stringOrRegex | The comparison string, which can be a regular expression, for example, "us.*" matches "us-west-1" . |
tsExpression | The expression that describes the time series with the metadata string to be compared. |
Example
In the following example:
- The first argument is the point tag key
service
. - The second argument is the string
"dataingester"
. - The function checks wither the value of
service
is equal to"dataingester"
for the text string that’s the third argument.
In the hover text, we can see that the point tag value is indeed equal to "dataingestor"