Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request that Elasticsearch cat shards and cat indices show closed indices as CLOSED instead of STARTED #62071

Open
mark54g opened this issue Sep 7, 2020 · 2 comments
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >enhancement

Comments

@mark54g
Copy link
Contributor

mark54g commented Sep 7, 2020

This request is to have Elasticsearch, in response to v7.2's change in behavior per: #33888 - show closed indices as CLOSED rather than STARTED, plus, a way to get a quick count back of all shards/indices in all states.

Something along the lines of:

.watcher-history-10-2020.09.02  0     p      STARTED     11520  13.9mb 127.0.0.1 mv7-1
.watcher-history-10-2020.09.01  0     p      STARTED     11520  13.9mb 127.0.0.1 mv7-1
.watches                        0     p      STARTED         6 129.1mb 127.0.0.1 mv7-1
.monitoring-es-7-2020.09.07     0     p      STARTED    268263 285.3mb 127.0.0.1 mv7-1
.kibana_1                       0     p      STARTED        73 202.4kb 127.0.0.1 mv7-1
.watcher-history-10-2020.09.06  0     p      STARTED     11520  12.5mb 127.0.0.1 mv7-1
.monitoring-es-7-2020.09.04     0     p      STARTED    329063 171.1mb 127.0.0.1 mv7-1
.kibana_task_manager            0     p      STARTED         2  30.9kb 127.0.0.1 mv7-1
.monitoring-kibana-7-2020.09.02 0     p      STARTED      8636   2.9mb 127.0.0.1 mv7-1
test1                           0     p      CLOSED         4   3.5kb 127.0.0.1 mv7-1

with, perhaps a way to hit _cat/shards?c (which doesn't exist, yet) to show a list of:

STARTED          across $NODES: 21
UNASSIGNED       across $NODES: 1
CLOSED           across $NODES: 1

etc

A way to also differentiate when doing a _cat/allocation as well, would help to quickly get to the root of issues faster

@mark54g mark54g added >enhancement needs:triage Requires assignment of a team area label labels Sep 7, 2020
@dnhatn dnhatn added the :Data Management/Indices APIs APIs to create and manage indices and templates label Sep 7, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Indices APIs)

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Sep 7, 2020
@dnhatn dnhatn removed Team:Data Management Meta label for data/management team needs:triage Requires assignment of a team area label labels Sep 7, 2020
@sastorsl
Copy link

sastorsl commented Aug 23, 2021

I agree that it would be handy to get a summary / count from the API.

Allthough it is quite easy to get that with a script.

/_cat/shards?h=state | sort | uniq -c

Or the more elaborate:

/_cat/shards?h=state | awk '{ arr[$1]++ } END { for (i in arr) printf("%-20s across $nodes: %6i\n", i, arr[i]) | "sort" }'
RELOCATING           across $nodes:      2
STARTED              across $nodes:   6924

However, I would also like to be able to see if an index is closed by looking directly at the shards, and I haven't been able to discover any safe method. One can look at if docs is null, but that isn't really safe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >enhancement
Projects
None yet
Development

No branches or pull requests

4 participants