Using filter(x) in a Query
Use filter(x)
to remove values from the metric streams in the returned data, where the metric streams are defined by the previous query components.
- Example: Remove Values Less than 20
-
CpuUtilization[1m].mean().filter(x=>x>20)
For query troubleshooting, see Troubleshooting Queries.
This section describes how to use
filter(x)
on the Metrics Explorer page.filter(x)
is available in Advanced mode (MQL) only. For alarm query edits, see Creating a Basic Alarm.Use the oci monitoring metric-data summarize-metrics-data command and required parameters to query metric data. Use the
--query-text
parameter to employ thefilter(x)
element (part of the MQL expression).oci monitoring metric-data summarize-metrics-data --query-text <mql_expression> [...]
For a complete list of parameters and values for CLI commands, see the Command Line Reference for Monitoring.
Run the SummarizeMetricsData operation to query metric data. Use the
query
attribute to employ thefilter(x)
element (part of the MQL expression).