---
title: "ezgh obs datasets transforms test"
description: "Try transform rules on sample records without saving them."
---

> 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 datasets transforms 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 datasets transforms test <dataset> -f <rules.json> --records <otlp.json> --signal logs|traces|metrics [flags]
```

Run a draft document's rules for one signal on sample records, as ingest would, and show what they did; nothing is saved. -f is the document (as for set, or the output of get -o json); `--records` is an OTLP/JSON export request of the signal (&#123;"resourceLogs": …&#125;, &#123;"resourceSpans": …&#125; or &#123;"resourceMetrics": …&#125;). Every resource runs the rules, whatever its environment. The rules and records go in one request of at most 1 MiB, the records at most 256 KiB.

It shows how many records the rules dropped and where they were in the input (resource, scope, record and item, numbered from 0), the rules that failed on a record (a failing statement is skipped and a failing condition is false, as at ingest) and, for metrics, input points from different series that the rules put in the same series at the same time. `--output-records` writes the transformed records (OTLP/JSON, the input's order minus what was dropped) to a file; -o json prints the whole answer.

Part of [`ezgh obs datasets transforms`](/cli/reference/obs-datasets-transforms).

## Examples

```sh
ezgh obs datasets transforms test production -f rules.json --records sample-logs.json --signal logs
ezgh obs datasets transforms get production -o json | ezgh obs datasets transforms test production -f - --records spans.json --signal traces --output-records out.json
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `-f`, `--file` | string |  | the rules' JSON file, or - for stdin |
| `--output-records` | string |  | write the transformed records (OTLP/JSON) to this file |
| `--records` | string |  | an OTLP/JSON export request of the signal, or - for stdin |
| `--signal` | string |  | the signal whose rules run: logs, traces or metrics |

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

Source: https://docs.ezghcloud.com/cli/reference/obs-datasets-transforms-test/index.mdx
