---
title: "ezgh obs alert-rules test"
description: "Evaluate a rule file once, without saving it."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ezgh obs alert-rules test

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh obs alert-rules test -f <file.json> [--at RFC3339] [flags]
```

Evaluate a rule file once, as obs-alerts would, and save nothing: it prints the instances the rule would have (each as if it had just become active: pending, or firing when for is 0m), how many rows and bytes the evaluation read, and any warnings. `--at` evaluates at another time (RFC 3339) instead of now. The file is a rule document, as apply takes it.

A rule that would read more than an evaluation may is refused with rule_too_expensive, with what it read and the budget it went over; narrow its condition (fewer series, a shorter window). Each problem with the document is printed as path: message. It needs read access to what the condition reads, as apply does.

Part of [`ezgh obs alert-rules`](/cli/reference/obs-alert-rules).

## Examples

```sh
ezgh obs alert-rules test -f alerts/high-latency.json
ezgh obs alert-rules test -f rule.json --at 2026-10-13T09:00:00Z
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--at` | string |  | evaluate at this time (RFC 3339; default now) |
| `-f`, `--file` | string |  | the rule's JSON file, or - for stdin |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/obs-alert-rules-test/index.mdx
