---
title: "ezgh obs datasets create"
description: "Create a dataset for an environment, before it sends data."
---

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

{/* 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 create <environment> [--name n] [--retention-class c] [--placement hot|cold] [--allow-cold-ingest] [flags]
```

Create the dataset for an environment. Ingest creates it anyway the first time the environment sends a record (with the default retention class, 7d-30d, and hot placement); creating it first lets you choose those before data arrives. The environment is lowercased and trimmed, as ingest does with ezgh.metadata.environment, and can't change later. An environment that already has a dataset is refused (environment_taken).

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

## Examples

```sh
ezgh obs datasets create production --retention-class 14d-365d
ezgh obs datasets create archive --retention-class cold-365d --placement cold --allow-cold-ingest
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--allow-cold-ingest` | boolean |  | let senders write straight to cold storage (x-ezgh-placement: cold) |
| `--name` | string |  | a display name (default: the environment) |
| `--placement` | string |  | where records go unless a sender asks otherwise: hot (searched fastest) or cold (default: hot) |
| `--retention-class` | string |  | how long data is kept; see ezgh obs retention-classes list (default: 7d-30d) |

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

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