Welcome back! In this guide, we explore several REST API commands that allow you to fetch essential cluster information and metadata from your Elasticsearch deployment. These commands are invaluable for monitoring, debugging, and managing Elasticsearch indices, shards, disk usage, and more.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.

The following commands help you gather comprehensive insights including cluster health, detailed statistics, index settings, and more.
Retrieving Cluster Details
Start by checking the overall health of your Elasticsearch cluster. The following GET command provides a snapshot of cluster status:Creating and Querying an Index
In this section, you’ll learn how to create an index and add a document to inspect index-specific configurations and statistics.Step 1: Create the “products” Index
Create an index named “products” by running:Step 2: Insert a Document
Add a sample document to the “products” index with the following POST request:Step 3: Verify the Document
To ensure the document has been stored correctly, retrieve it using:Step 4: Check Index Settings and Statistics
Inspect the index’s settings (like the number of shards and replicas) and detailed statistics by executing:Updating Index Settings
If you need to adjust dynamic settings for an index (for example, increasing the number of replicas), use a PUT request. The following command updates the dynamic setting for the “products” index:Not all settings are dynamic. Many cluster-wide settings are persistent and must be modified in configuration files rather than through the REST API. Also, certain cluster-wide settings cannot be deleted directly using REST API calls.
Summary
In this guide, you learned how to:- Retrieve cluster health, comprehensive statistics, and configuration settings.
- List all indices and review their health statuses.
- Create a new index (“products”) and insert a document.
- Fetch specific index settings and detailed statistics.
- Update dynamic index settings, such as the number of replicas.