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 than
  • lt - Less than
  • gte - Greater than or equals
  • lte - Less than or equals
  • function - 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.ApplicationELB.TargetResponseTime",
  {"loadbalancer": "*"},
  {period: "60"}),
  {gt:"0.025",function:"max"}
)

The ELB instances whose average latency never went above 0.025 seconds are not rendered on the chart:

composite-filter-max

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.ApplicationELB.TargetResponseTime",
  {"loadbalancer": "*"},
  {function:"mean"}),
  {gt:"0.025",function:"min"}
)

composite-filter-min