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

# export

> Download monitoring data from an inference pipeline

The `openlayer export` command downloads monitoring data from an inference pipeline
for a specified time period.

It supports flexible ways to specify date ranges and optional filters to refine the
exported dataset.

## Usage

```bash theme={null}
openlayer export [inference_pipeline_id] [start] [end]
```

This will fetch your monitoring data from the inference pipeline and place
a `dataset.json` and `config.json` file in `./openlayer-exports/{pipeline_name}_{start}_{end}`.

## Date ranges

You can specify time ranges in multiple ways:

```bash theme={null}
# Date ranges (inclusive of end date)
openlayer export my-pipeline --from 2025-08-01 --to 2025-08-10
openlayer export my-pipeline --from "Aug 1, 2025" --to "Aug 10, 2025"
openlayer export my-pipeline --from 2025-08-01T10:00:00 --to 2025-08-10T18:00:00

# Unix timestamps (legacy mode)
openlayer export my-pipeline --from 1724659200 --to 1725340800

# Relative ranges
openlayer export my-pipeline --last 7d
openlayer export my-pipeline --last 2h30m

# Preset ranges
openlayer export my-pipeline --range this-week

# Legacy positional arguments (still supported)
openlayer export my-pipeline 1724659200 1725340800
```

## Filters

You can refine the exported dataset using `--filter` flags or a JSON file.

### Simple syntax

```bash theme={null}
# Numerical comparisons
openlayer export my-pipeline --filter 'confidence_score>=0.8'
openlayer export my-pipeline --filter 'age>25' --filter 'score<=100'

# String equality
openlayer export my-pipeline --filter 'status=active' --filter 'region!=test'

# Array/list operations
openlayer export my-pipeline --filter 'region in [US,CA,UK]'
openlayer export my-pipeline --filter 'tags contains any [prod,staging]'
```

### JSON file (advanced)

For more complex filters, pass a JSON file:

```bash theme={null}
openlayer export my-pipeline --filters-file filters.json
```

## Flags

| Flag             | Default                   | Description                                                      |
| ---------------- | ------------------------- | ---------------------------------------------------------------- |
| `--from`         | `""`                      | Start of the time range (date, timestamp, or relative).          |
| `--to`           | `""`                      | End of the time range (date, timestamp, or relative).            |
| `--last`         | `""`                      | Relative duration (e.g. `7d`, `2h30m`).                          |
| `--range`        | `""`                      | Preset range (e.g. `this-week`, `last-month`).                   |
| `--output-dir`   | `./openlayer-exports/...` | Directory where the exported files will be placed.               |
| `--filter`       | `[]`                      | Apply one or more filters using simple syntax (can be repeated). |
| `--filters-file` | `""`                      | Path to a JSON file with advanced filters.                       |
