## FROM

The `FROM` command retrieves data from a data stream, index, or alias and returns it as a table. Each row in the table represents a document, and each column corresponds to a field that can be accessed by its name.

## Syntax

`FROM index_pattern [METADATA fields]`

### Parameters

#### `index_pattern`

A list of indices, data streams, or aliases. Supports wildcards and date math.

#### `fields`

A comma-separated list of metadata fields to retrieve.

## Examples

### Basic Example

Retrieve all documents from the `employees` index:

```esql
FROM employees
```

### Querying Multiple Data Streams, Indices, or Aliases

Query multiple data streams, indices, or aliases using a comma-separated list or wildcards:

```esql
FROM employees-00001,other-employees-*
```

### Querying Across Clusters

Query data streams and indices on remote clusters using the format `<remote_cluster_name>:<target>`:

```esql
FROM cluster_one:employees-00001,cluster_two:other-employees-*
```

### Using the `METADATA` Directive

Enable metadata fields by using the optional `METADATA` directive:

```esql
FROM employees METADATA _id, _score
```
