filter(set[], options)¶
Given an arbitrary number of series, allows you to limit or exclude metric streams
based on the values the streams contain. The filter
function takes a series,
a set of bounds, and an aggregate function. It applies the function to each stream
and only returns streams whose result falls within the bounds provided.
gt
- Greater thanlt
- Less thangte
- Greater than or equalslte
- Less than or equalsfunction
- Aggregate function applied to each metric stream. Must be one of- min, max, sum, or mean. Defaults to mean.
Example:
The following expression will return all streams for ELB instances whose average latency peaked above 0.025 seconds within the last hour (or whatever duration is selected):
filter(s("AWS.ELB.Latency","*",{function:"mean"}),{gt:"0.025",function:"max"})
The ELB instances whose average latency never went above 0.025 seconds are not rendered on the chart:
To only show ELB instances where the mean latency never dropped below 0.025 seconds
during the last hour use function:"min"
:
filter(s("AWS.ELB.Latency","*",{function:"mean"}),{gt:"0.025",function:"min"})