Type to search.

Elastic CLI command reference

Serverless Preview

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Preview

    This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply.

Serverless interfaces and procedures might differ from classic Elastic Stack deployments.

Stack Preview

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Preview

    This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

The Elastic CLI command reference lists available namespaces, commands, options, and input schemas. Commands are grouped by the service or resource they manage.

For installation, configuration, and tutorials, refer to the Elastic CLI documentation.

Use the page navigation to browse the command tree. To explore the same hierarchy from the terminal, run elastic --help or append --help to a command, such as elastic es info --help. To inspect a command's input schema programmatically, combine --help with --json, for example elastic es info --help --json.

The elastic es and elastic kb shortcuts are equivalent to elastic stack es and elastic stack kb.

--output-fields string
comma-separated list of fields to include in output (dot-notation supported)
--output-template string
Mustache-like template for custom text output (e.g. "{{id}}: {{name}}")
--json
output as JSON
version

Print the elastic CLI version

help

Show help topics

stack

Interact with Elastic Stack components (Elasticsearch, Kibana, Fleet)

cloud

Manage Elastic Cloud (hosted deployments and serverless projects)

docs

Search, read, and ask questions about Elastic documentation

config

Author and maintain the elastic config file

sanitize

Sanitize values for safe use in Elasticsearch

ELASTIC_CLI_CONFIG_FILE
Override the config file path (precedence: --config-file > this > home directory discovery)
ELASTIC_NO_BANNER
Set to 1 to suppress the startup logo
ELASTIC_CLOUD_ADMIN_API
Override the Elastic Cloud admin API base URL
ELASTIC_CLI_TELEMETRY
Set to a falsey value (false/0/no/off) to turn off collection of anonymous telemetry; overrides the config telemetry field
~/.elasticrc.yml
Primary config file (recommended)
~/.elasticrc.yaml
Alternative YAML extension
~/.elasticrc.json
JSON form of the config file
~/.elasticrc

Extensionless form of the config file