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

# aptible log_drain:create:elasticsearch

This command lets you create a [Log Drain](/docs/core-concepts/observability/logs/log-drains/overview) to forward your container logs to an [Elasticsearch Database](/docs/core-concepts/managed-databases/supported-databases/elasticsearch) hosted on Aptible.

<Note>You must choose a destination Elasticsearch Database that is within the same Environment as the Log Drain you are creating.</Note>

# Synopsis

```
Usage:
  aptible log_drain:create:elasticsearch HANDLE [flags]

Flags:
      --db string                     Elasticsearch database handle (required)
      --drain-apps                    Drain app logs (default true)
      --drain-databases               Drain database logs (default true)
      --drain-ephemeral-sessions      Drain ephemeral session logs (default true)
      --drain-proxies                 Drain proxy logs (default true)
  -e, --env string                    Environment handle (alias)
      --environment string            Environment handle (required)
      --no-drain-apps                 Do not drain app logs
      --no-drain-databases            Do not drain database logs
      --no-drain-ephemeral-sessions   Do not drain ephemeral session logs
      --no-drain-proxies              Do not drain proxy logs
      --pipeline string               Elasticsearch pipeline (optional)
```
