---
name: azion-filter-a-real-time-metrics-dashboard
description: >-
  Narrow every chart of a Real-Time Metrics dashboard to the requests you need, and apply the same filters to a GraphQL query.
---

# Filter a Real-Time Metrics dashboard

You can narrow the charts of a [Real-Time Metrics](/en/documentation/platform/real-time-metrics/) dashboard in Azion Console, or apply the same filters to a query with the GraphQL API. For every field, operator, and value type a filter accepts, refer to [Filters and time range](/en/documentation/platform/real-time-metrics/filters-and-time-range/#filters).

With no filter, a dashboard counts the data of your whole account. A filter keeps only the data whose field matches a value, such as the host, the status code, the request method, or the country. In the GraphQL API, these fields are `host`, `status`, `requestMethod`, and `geolocCountryName`.

Select your interface once. The prerequisites and each task on this page show only that path.

## Prerequisites

- An [application](/en/documentation/platform/applications/) with requests in the time range you read.
- A host your [workload](/en/documentation/platform/workloads/) answers on, such as `www.example.com`, to combine filters.

**Console**

- Access to Azion Console. To sign in, refer to [How to access Azion Console](/en/documentation/guides/platform/account-and-billing/how-to-access-azion-console/).

**API**

- A personal token. To create one, refer to [How to manage a personal token](/en/documentation/guides/platform/account-and-billing/personal-tokens/).
- `curl`.

---

## Add a filter

This task keeps the requests that returned an error, with a status code of 400 or higher. Every chart of the dashboard then counts only those requests.

**Console**

To filter the dashboard by status code in Azion Console:

1. **Open Real-Time Metrics**

   Access [Azion Console](https://console.azion.com/) > **Real-Time Metrics**.

   The page opens on **Build** › **Applications** › **Data Transferred**.

2. **Open the Filter popover**

   In the filter row, select the filter icon, whose tooltip reads **Add filter**.

3. **Select the Status field**

   In **Filter**, select **Status**.

4. **Select the operator**

   In **Operator**, select **Greater Than or Equal**.

5. **Enter the value**

   Enter `400` as the value.

6. **Select Apply**

A chip under the filter row reads `Status greater than or equal: 400`. Every chart of the dashboard now counts only the requests with a status code of 400 or higher.

**API**

To apply the same filter with the GraphQL API, send a `POST` request to `https://api.azion.com/v4/metrics/graphql`. In `filter`, the `statusGte` key keeps the status codes of 400 or higher, next to the `tsRange` that every query requires. The query sums `requests` for each status code.

Replace `[TOKEN VALUE]` with your personal token, and the `begin` and `end` values with the period you want to read:

```bash
curl -X POST 'https://api.azion.com/v4/metrics/graphql' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Token [TOKEN VALUE]' \
  -d '{"query":"query ErrorRequestsByStatus($begin: DateTime!, $end: DateTime!) { httpMetrics(limit: 100, filter: { tsRange: { begin: $begin, end: $end }, statusGte: 400 }, aggregate: { sum: requests }, groupBy: [status], orderBy: [sum_DESC]) { status sum } }","variables":{"begin":"2026-01-01T12:00:00","end":"2026-01-02T12:00:00"}}'
```

The API answers `200` with one row for each status code of 400 or higher:

```json
{
  "data": {
    "httpMetrics": [
      {
        "status": 496,
        "sum": 210
      },
      {
        "status": 501,
        "sum": 198
      },
      {
        "status": 495,
        "sum": 73
      },
      {
        "status": 404,
        "sum": 55
      },
      {
        "status": 502,
        "sum": 31
      },
      {
        "status": 401,
        "sum": 12
      },
      {
        "status": 400,
        "sum": 1
      },
      {
        "status": 499,
        "sum": 1
      },
      {
        "status": 504,
        "sum": 1
      }
    ]
  }
}
```

Each row holds one status code and its request count in the range. A filter key is a field name followed by its operator, such as `statusGte` or `hostEq`. For every operator, refer to [GraphQL queries](/en/documentation/devtools/graphql/features/#operators).

---

## Combine filters

Each filter you add narrows the data again, so the charts keep only the data that matches every filter. This task adds a host to the status filter from Add a filter, to read the errors of one host. Replace `www.example.com` with a host your workload answers on.

**Console**

To add a second filter in Azion Console:

1. **Open the Filter popover**

   In the filter row, select the filter icon, whose tooltip reads **Add filter**.

2. **Select the Host field**

   In **Filter**, select **Host**.

3. **Select the Equals operator**

   In **Operator**, select **Equals**.

4. **Enter the host**

   Enter `www.example.com` as the value.

5. **Select Apply**

A second chip reads `Host equals: www.example.com`, next to the status chip. Every chart now counts only the requests to that host with a status code of 400 or higher.

The **Filter** popover states `Each combination of operator can only be used once.` To keep any of several values of one field, use the `in` form of the query input, described in Filter with the query input.

**API**

To combine filters with the API, add each one as a key of `filter`. This query adds `hostEq` to the `statusGte` filter:

```bash
curl -X POST 'https://api.azion.com/v4/metrics/graphql' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Token [TOKEN VALUE]' \
  -d '{"query":"query ErrorRequestsForHost($begin: DateTime!, $end: DateTime!) { httpMetrics(limit: 100, filter: { tsRange: { begin: $begin, end: $end }, statusGte: 400, hostEq: \"www.example.com\" }, aggregate: { sum: requests }, groupBy: [status], orderBy: [sum_DESC]) { status sum } }","variables":{"begin":"2026-01-01T12:00:00","end":"2026-01-02T12:00:00"}}'
```

The API answers `200` with the error responses of that host alone:

```json
{
  "data": {
    "httpMetrics": [
      {
        "status": 501,
        "sum": 198
      },
      {
        "status": 404,
        "sum": 29
      },
      {
        "status": 504,
        "sum": 1
      }
    ]
  }
}
```

Each row counts only the requests that match both filters.

To keep any of several values of one field, use the `In` operator with a list. For example, `statusIn: [404, 502]` in place of `statusGte: 400` returns only the rows of `404` and `502` over the same range, with the same counts as in the response of Add a filter.

---

## Filter with the query input

The query input in the filter row takes filters as one typed expression in Azion Query Language. It also keeps several values of one field at once, which a single **Equals** filter cannot do. This task keeps the requests that returned `404` or `502`.

To filter with the query input in Azion Console:

1. **Open Real-Time Metrics**

   Access [Azion Console](https://console.azion.com/) > **Real-Time Metrics**.

2. **Select the query input**

   In the filter row, select the query input, whose placeholder reads `Filter using Azion Query Language syntax...`.

3. **Enter the expression**

   Enter `status in (404, 502)`.

   While you type, the input suggests fields, then operators, then values. `Ctrl` + `Space`, or `Cmd` + `Space`, opens the suggestions.

4. **Apply the expression**

   Press `Enter`.

Every chart of the dashboard now counts only the requests that returned `404` or `502`.

To keep a range of values instead, use `between` with exactly two values: `status between (400, 499)` keeps the status codes from 400 to 499. For the syntax of each operator in the query input, refer to [Filters and time range](/en/documentation/platform/real-time-metrics/filters-and-time-range/#query-input). When the input shows a validation message and **Refresh** stays disabled, refer to [Troubleshoot Real-Time Metrics](/en/documentation/platform/real-time-metrics/troubleshooting/).

---

## Edit or remove a filter

Each applied filter shows as a chip under the filter row. Selecting a chip reopens that filter, and its remove icon deletes it.

To edit a filter in Azion Console:

1. **Open the filter**

   Under the filter row, select the chip of the filter.

   The **Filter** popover opens with the values of that filter. A lock icon replaces the arrow of the field, because the field cannot change.

2. **Change the operator or the value**

3. **Select Apply**

The chip shows the new operator or value, and every chart of the dashboard follows the changed filter.

To remove a filter, select the remove icon on its chip, and repeat for each filter you want to remove. The chip disappears, and the charts stop applying that filter.

Switching to a dashboard that reads another dataset clears every filter and keeps the time range.

---

## Next steps

- [Filters and time range](/en/documentation/platform/real-time-metrics/filters-and-time-range.md): Every field, operator, and value type a filter accepts, and the syntax of the query input.
- [Export a chart's data and query](/en/documentation/guides/platform/observability/analyze-metrics.md): Download a filtered chart as CSV, or copy its GraphQL query with the filter values.
- [Build dashboards](/en/documentation/platform/real-time-metrics/build-dashboards.md): Each Build dashboard, the dataset it reads, and what each chart plots.
- [Troubleshoot Real-Time Metrics](/en/documentation/platform/real-time-metrics/troubleshooting.md): What each validation message of the query input means, and how to fix the expression.
