Back to Elasticsearch in Google Sheets
SheetXAI logo
Elasticsearch logo
Elasticsearch · Google Sheets Guide

Export Your Elasticsearch Cluster Index Inventory Into a Google Sheet

2026-05-14
5 min read

The Scenario

Your team's capacity review is on Thursday. The platform engineer who ran the last inventory left three months ago, and nobody updated the doc since. What you have is a stale Notion page listing 14 indices from a cluster that now has somewhere north of 30.

You've been handed the spreadsheet template: index name in column A, health status in column B, document count in column C. Your job is to fill it in before the meeting.

The bad version:

  • SSH into the cluster, run GET _cat/indices?v in the dev tools console, get a wall of text back
  • Manually parse the output — health is column 1, index name is column 3, doc count is column 6, approximately — and start copying rows into your sheet
  • Discover that the output includes system indices starting with . that you don't want, filter those out by hand, lose count, start over

This is supposed to be an inventory, not a data entry exercise. The meeting is in two days and you have other fires.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent that lives inside your Google Sheet. It connects to your Elasticsearch cluster, pulls the index list, and writes each row into your sheet — without you touching the cat API output or reformatting anything by hand.

List all indices in my Elasticsearch cluster, exclude system indices starting with ".", and write each index name, health status, and document count into my "Cluster Inventory" sheet starting at row 2, with headers already in row 1

What You Get

  • Column A fills with each index name, one per row, system indices excluded
  • Column B shows the health status — green, yellow, or red — for each index
  • Column C has the current document count
  • The sheet starts at row 2 to preserve your existing headers in row 1
  • The run completes in one pass — no pagination to manage, no row count to track

What If the Data Is Not Quite Ready

You also need the primary shard count per index

The default inventory template your team uses has a fourth column for primary shard count, which doesn't come back automatically.

List all non-system indices in my Elasticsearch cluster and write index name, health status, document count, and primary shard count into columns A through D of my "Cluster Inventory" sheet

The sheet already has stale data from the last inventory

Your sheet has 14 rows from the old inventory and you don't want to manually delete them first.

Clear all data from row 2 downward in my "Cluster Inventory" sheet, then pull all non-system indices from my Elasticsearch cluster and write index name, health status, and document count into columns A, B, and C starting at row 2

You need to flag any indices in red or yellow health

After pulling the inventory, you want column D to call out indices that need attention.

List all non-system Elasticsearch indices in my "Cluster Inventory" sheet — index name in column A, health in column B, doc count in column C — then write "action needed" in column D for any index with health status yellow or red, and "ok" for green

Wipe the stale data, pull the live inventory, flag health issues, and note anything with zero docs in one pass

Clear rows 2 and below in my "Cluster Inventory" sheet, then fetch all non-system indices from my Elasticsearch cluster and write index name, health, doc count, and shard count into columns A through D — in column E, flag "zero docs" for any index where doc count is 0 and "needs review" for any index with health yellow or red

The pattern: state the cleanup and the fetch and the conditional logic together. SheetXAI handles all three without a separate run per step.

Try It

Get the 7-day free trial of SheetXAI and open the Google Sheet you're using for your capacity review — describe the columns you need and ask it to pull the live index inventory in one prompt. Also worth looking at: batch-querying your Elasticsearch indices from the sheet and pulling an index schema into a data dictionary.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more