---
title: "ezgh obs datasets transforms set"
description: "Replace a dataset's transform rules from a JSON file."
---

> 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 set

{/* 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 set <dataset> -f <rules.json> [--force] [flags]
```

Replace a dataset's transform rules with a JSON document (-f - reads stdin):

```text
{ "enabled": true,
  "logs": { "statements": [ "delete_key(log.attributes, \"user.email\")" ],
            "drop": [ "log.severity_number < SEVERITY_NUMBER_INFO" ] },
  "traces": { "drop": [ "span.name == \"GET /healthz\"" ] } }
```

Each signal's statements run in order on every record before it's stored, then a record is dropped when any of its drop conditions holds. A signal can have at most 50 statements and 50 conditions, each at most 4 KiB, and the document at most 64 KiB. obs-api compiles every rule and refuses a document that doesn't, saying where (logs.statements.3) and why. The file can be the output of `ezgh obs datasets transforms get -o json`: its document is taken.

It's sent with the ETag ezgh reads just before: if someone changed the rules in between, nothing changes, and ezgh says so. A file from get -o json carries the version it was read at: when the rules have changed since (someone saved another version while you edited), ezgh refuses and changes nothing. `--force` sends no ETag, overwriting whatever is there.

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

## Examples

```sh
ezgh obs datasets transforms set production -f rules.json
ezgh obs datasets transforms set staging -f - --force < rules.json
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `-f`, `--file` | string |  | the rules' JSON file, or - for stdin |
| `--force` | boolean |  | send no ETag: overwrite the rules even if they changed since they were read |

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

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