contains
Input Stack: |
⇨ |
Output Stack: |
Select time series where the value for a tag key contains the specified substring anywhere
within the value. This provides a more efficient alternative to regular expressions when you
only need simple substring matching. It performs exact substring matching and is case-sensitive.
Parameters
- key: The tag key to check (e.g.,
name
, nf.app
)
- value: The substring that must appear anywhere within tag values
Examples
Find all metrics whose name contains "Cpu":
name,Cpu,:contains
When matching against sample data, the highlighted time series would be included:
Name | nf.app | nf.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 |
- :starts - Match by prefix only
- :ends - Match by suffix only
- :eq - Exact string matching
- :re - Full regular expression matching (more powerful but slower)
- :and / :or - Combine with other query conditions