### Elasticsearch Version

8.0.0 (still true in `master` tho)

### Installed Plugins

N/A

### Java Version

_bundled_

### OS Version

N/A

### Problem Description

`GET _cat/shards` reports a line for every shard in the cluster, but any lines for shards that belong to hidden indices are mostly blank. The reason is that this API performs two transport actions. The first action retrieves the cluster state from the master, and the result determines the list of indices to show but does not use `IndicesOptions` to filter any of them out. The second action retrieves stats from each shard, and this action accepts an `IndicesOptions` to control which ones are shown. No `IndicesOptions` is given, however, so it follows the default behaviour which skips hidden indices.

### Steps to Reproduce

1. Start a cluster
2. Use some features that create hidden indices
3. Execute `GET _cat/shards` and notice that some data is missing.

### Logs (if relevant)

<details>
<summary>Expand for output</summary>

```
GET /_cat/shards?h=*&v

# 200 OK
# index                                                         shard prirep state      docs   store ip             id                     node                sync_id                unassigned.reason unassigned.at unassigned.for unassigned.details recoverysource.type completion.size fielddata.memory_size fielddata.evictions query_cache.memory_size query_cache.evictions flush.total flush.total_time get.current get.time get.total get.exists_time get.exists_total get.missing_time get.missing_total indexing.delete_current indexing.delete_time indexing.delete_total indexing.index_current indexing.index_time indexing.index_total indexing.index_failed merges.current merges.current_docs merges.current_size merges.total merges.total_docs merges.total_size merges.total_time refresh.total refresh.time refresh.external_total refresh.external_time refresh.listeners search.fetch_current search.fetch_time search.fetch_total search.open_contexts search.query_current search.query_time search.query_total search.scroll_current search.scroll_time search.scroll_total segments.count segments.memory segments.index_writer_memory segments.version_map_memory segments.fixed_bitset_memory seq_no.max seq_no.local_checkpoint seq_no.global_checkpoint warmer.current warmer.total warmer.total_time path.data path.state bulk.total_operations bulk.total_time bulk.total_size_in_bytes bulk.avg_time bulk.avg_size_in_bytes
# .ds-.logs-deprecation.elasticsearch-default-2022.02.27-000006 0     p      STARTED                 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000
# .ds-.logs-deprecation.elasticsearch-default-2022.02.27-000006 0     r      STARTED                 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004
# .security-7                                                   0     p      STARTED     117   322kb 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000                                                                                                                           0b                    0b                   0                      0b                     0           2             16ms           0       0s         5              0s                0               0s                 5                       0                  3ms                     2                      0               118ms                  115                     0              0                   0                  0b           13              1232             3.3mb             849ms           126         1.8s                    121                    2s                 0                    0             26.8s             601846                    0                    0             45.7s             601846                     0               1.5m              140176              9              0b                           0b                          0b                           0b        702                     702                      702              0          120               4ms /app/data  /app/data                   117           125ms                   634926           1ms                   8656
# .security-7                                                   0     r      STARTED     117   322kb 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004                                                                                                                           0b                    0b                   0                      0b                     0           2             19ms           0       0s         4              0s                0               0s                 4                       0                  3ms                     2                      0               136ms                  115                     0              0                   0                  0b           13              1232             3.3mb             662ms           123         1.5s                    121                  1.6s                 0                    0              9.7s             303496                    0                    0             26.2s             303496                     0               1.3m               40954              9              0b                           0b                          0b                           0b        702                     702                      702              0          120               7ms /app/data  /app/data                   117           142ms                   634926           1ms                   8655
# .monitoring-kibana-7-2022.03.02                               0     p      STARTED   17280   9.4mb 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000                                                                                                                           0b                  288b                   0                    376b                     0           1               0s           0       0s         0              0s                0               0s                 0                       0                   0s                     0                      0                9.1s                17280                     0              0                   0                  0b          634           2527360             1.3gb             33.7s          6363          48s                   6311                   53s                 0                    0                1s              13973                    0                    0              2.3m              39262                     0                 0s                   0              2              0b                           0b                          0b                           0b      17279                   17279                    17279              0         6310             217ms /app/data  /app/data                  8640            9.4s                 15964133           1ms                   1850
# .monitoring-kibana-7-2022.03.02                               0     r      STARTED   17280   9.5mb 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004                                                                                                                           0b                  432b                   0                      0b                     0           2             22ms           0       0s         0              0s                0               0s                 0                       0                   0s                     0                      0                 10s                17278                     0              0                   0                  0b          629           2506122             1.2gb             32.3s          6238        46.8s                   6235                 51.8s                 0                    0             920ms              11947                    0                    0                2m              36617                     0                 0s                   0              7              0b                           0b                          0b                           0b      17279                   17279                    17279              0         6234             197ms /app/data  /app/data                  8639           10.2s                 15962280           1ms                   1850
# .kibana_7.17.0_001                                            0     p      STARTED     366  10.6mb 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000                                                                                                                           0b                    0b                   0                      0b                     0           1               0s           0      7ms        32             7ms               27               0s                 5                       0                   0s                     0                      0                  0s                    0                     0              0                   0                  0b            0                 0                0b                0s             6           0s                      2                   1ms                 0                    0              44ms                 35                    0                    0              20ms                 49                     0                 0s                   0              9              0b                           0b                          0b                         472b        407                     407                      407              0            1               1ms /app/data  /app/data                     0              0s                        0            0s                      0
# .kibana_7.17.0_001                                            0     r      STARTED     366  10.6mb 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004                                                                                                                           0b                    0b                   0                      0b                     0           1               0s           0      6ms        17             6ms               16               0s                 1                       0                   0s                     0                      0                  0s                    0                     0              0                   0                  0b            0                 0                0b                0s             3           0s                      2                   5ms                 0                    0               1ms                 22                    0                    0              13ms                 28                     0                 0s                   0              9              0b                           0b                          0b                         472b        407                     407                      407              0            1               5ms /app/data  /app/data                     0              0s                        0            0s                      0
# .ds-.slm-history-5-2022.01.16-000013                          0     p      STARTED                 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000
# .ds-.slm-history-5-2022.01.16-000013                          0     r      STARTED                 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004
# .metrics-endpoint.metadata_united_default                     0     p      STARTED                 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000
# .metrics-endpoint.metadata_united_default                     0     r      STARTED                 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004
# .monitoring-alerts-7                                          0     p      STARTED      25  78.6kb 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000                                                                                                                           0b                    0b                   0                      0b                     0           5            110ms           0       0s         0              0s                0               0s                 0                       0                   0s                     0                      0                12ms                    9                     0              0                   0                  0b            0                 0                0b                0s            33         92ms                     20                  95ms                 0                    0             10.7s             273647                    0                    0             52.3s             273647                     0                 0s                   0              9              0b                           0b                          0b                           0b      80337                   80337                    80337              0           19                0s /app/data  /app/data                     9            13ms                     4918            0s                    330
# .monitoring-alerts-7                                          0     r      STARTED      25  87.5kb 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004                                                                                                                           0b                    0b                   0                      0b                     0           5            122ms           0       0s         0              0s                0               0s                 0                       0                   0s                     0                      0                11ms                    9                     0              0                   0                  0b            0                 0                0b                0s            22        105ms                     16                 106ms                 0                    0             11.9s             264643                    0                    0             49.5s             264643                     0                 0s                   0              9              0b                           0b                          0b                           0b      80337                   80337                    80337              0           15                0s /app/data  /app/data                     9            12ms                     4918            0s                    330
# .kibana_5                                                     0     p      STARTED     336  10.5mb 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000                                                                                                                           0b                    0b                   0                      0b                     0           1               0s           0       0s         0              0s                0               0s                 0                       0                   0s                     0                      0                  0s                    0                     0              0                   0                  0b            0                 0                0b                0s             6           0s                      2                   1ms                 0                    0                0s                  0                    0                    0                0s                  0                     0                 0s                   0              8              0b                           0b                          0b                         424b       2590                    2590                     2590              0            1               1ms /app/data  /app/data                     0              0s                        0            0s                      0
# .kibana_5                                                     0     r      STARTED     336  10.5mb 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004                                                                                                                           0b                    0b                   0                      0b                     0           1               0s           0       0s         0              0s                0               0s                 0                       0                   0s                     0                      0                  0s                    0                     0              0                   0                  0b            0                 0                0b                0s             3           0s                      2                   2ms                 0                    0                0s                  0                    0                    0                0s                  0                     0                 0s                   0              8              0b                           0b                          0b                         424b       2590                    2590                     2590              0            1               2ms /app/data  /app/data                     0              0s                        0            0s                      0
# .ds-.slm-history-5-2021.12.17-000011                          0     p      STARTED                 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000
# .ds-.slm-history-5-2021.12.17-000011                          0     r      STARTED                 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004
# .ds-.logs-deprecation.elasticsearch-default-2022.02.13-000005 0     p      STARTED                 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000
# .ds-.logs-deprecation.elasticsearch-default-2022.02.13-000005 0     r      STARTED                 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004
# .kibana-event-log-7.14.0-000008                               0     p      STARTED                 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000
# .kibana-event-log-7.14.0-000008                               0     r      STARTED                 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004
# .kibana_3                                                     0     r      STARTED     109  10.5mb 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000                                                                                                                           0b                    0b                   0                      0b                     0           1               0s           0       0s         0              0s                0               0s                 0                       0                   0s                     0                      0                  0s                    0                     0              0                   0                  0b            0                 0                0b                0s             3           0s                      2                   1ms                 0                    0                0s                  0                    0                    0                0s                  0                     0                 0s                   0              8              0b                           0b                          0b                         392b        360                     360                      360              0            1               1ms /app/data  /app/data                     0              0s                        0            0s                      0
# .kibana_3                                                     0     p      STARTED     109  10.5mb 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004                                                                                                                           0b                    0b                   0                      0b                     0           1               0s           0       0s         0              0s                0               0s                 0                       0                   0s                     0                      0                  0s                    0                     0              0                   0                  0b            0                 0                0b                0s             6           0s                      2                   3ms                 0                    0                0s                  0                    0                    0                0s                  0                     0                 0s                   0              8              0b                           0b                          0b                         392b        360                     360                      360              0            1               3ms /app/data  /app/data                     0              0s                        0            0s                      0
# ilm-history-3-000005                                          0     p      STARTED       0    208b 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000                                                                                                                           0b                    0b                   0                      0b                     0           1               0s           0       0s         0              0s                0               0s                 0                       0                   0s                     0                      0                  0s                    0                     0              0                   0                  0b            0                 0                0b                0s             7           0s                      2                    0s                 0                    0                0s                  0                    0                    0                0s                  0                     0                 0s                   0              0              0b                           0b                          0b                           0b         -1                      -1                       -1              0            1                0s /app/data  /app/data                     0              0s                        0            0s                      0
# ilm-history-3-000005                                          0     r      STARTED       0    208b 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004                                                                                                                           0b                    0b                   0                      0b                     0           1               0s           0       0s         0              0s                0               0s                 0                       0                   0s                     0                      0                  0s                    0                     0              0                   0                  0b            0                 0                0b                0s             3           0s                      2                    0s                 0                    0                0s                  0                    0                    0                0s                  0                     0                 0s                   0              0              0b                           0b                          0b                           0b         -1                      -1                       -1              0            1                0s /app/data  /app/data                     0              0s                        0            0s                      0
# .ds-ilm-history-5-2021.12.17-000011                           0     p      STARTED                 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000
# .ds-ilm-history-5-2021.12.17-000011                           0     r      STARTED                 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004
# .kibana-event-log-7.16.2-000001                               0     r      STARTED                 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000
# .kibana-event-log-7.16.2-000001                               0     p      STARTED                 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004
# .ds-.slm-history-5-2021.11.17-000010                          0     r      STARTED                 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000
# .ds-.slm-history-5-2021.11.17-000010                          0     p      STARTED                 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004
# .fleet-policies-7                                             0     p      STARTED       4  25.5kb 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000                                                                                                                           0b                    0b                   0                      0b                     0           2             12ms           0       0s         0              0s                0               0s                 0                       0                   0s                     0                      0                 3ms                    3                     0              0                   0                  0b            0                 0                0b                0s            11         39ms                      6                  40ms                 0                    0                0s                  1                    0                    0               1ms                  2                     0                 0s                   0              4              0b                           0b                          0b                           0b          3                       3                        3              0            5                0s /app/data  /app/data                     3             4ms                    10404            0s                   1014
# .fleet-policies-7                                             0     r      STARTED       4  25.5kb 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004                                                                                                                           0b                    0b                   0                      0b                     0           2             12ms           0       0s         0              0s                0               0s                 0                       0                   0s                     0                      0                 3ms                    3                     0              0                   0                  0b            0                 0                0b                0s             8         26ms                      6                  26ms                 0                    0                0s                  1                    0                    0               2ms                  2                     0                 0s                   0              4              0b                           0b                          0b                           0b          3                       3                        3              0            5                0s /app/data  /app/data                     3             3ms                    10404            0s                   1014
# .ds-.watcher-history-16-2022.03.01-000011                     0     p      STARTED                 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000
# .ds-.watcher-history-16-2022.03.01-000011                     0     r      STARTED                 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004
# ilm-history-2-000018                                          0     p      STARTED                 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000
# ilm-history-2-000018                                          0     r      STARTED                 172.27.47.21   bfcMDTiDRkietFb9v_di7w instance-0000000004
# .kibana-event-log-7.9.1-000018                                0     p      STARTED                 172.27.127.208 FIWiKrPpSx2Ik6IO-mMaWA instance-0000000000
...
```
</details>
server/src/main/java/org/elasticsearch/rest/action/cat/RestShardsAction.java
table.startRow();
            table.addCell(shard.getIndexName());
            table.addCell(shard.id());
            if (shard.primary()) {
                table.addCell("p");
            } else {
                table.addCell("r");
            }
            table.addCell(shard.state());
            table.addCell(getOrNull(commonStats, CommonStats::getDocs, DocsStats::getCount));
            table.addCell(getOrNull(commonStats, CommonStats::getStore, StoreStats::getSize));
            if (shard.assignedToNode()) {
                String ip = state.getState().nodes().get(shard.currentNodeId()).getHostAddress();
                String nodeId = shard.currentNodeId();
                StringBuilder name = new StringBuilder();
                name.append(state.getState().nodes().get(shard.currentNodeId()).getName());
                if (shard.relocating()) {
                    String reloIp = state.getState().nodes().get(shard.relocatingNodeId()).getHostAddress();
                    String reloNme = state.getState().nodes().get(shard.relocatingNodeId()).getName();
                    String reloNodeId = shard.relocatingNodeId();
                    name.append(" -> ");
                    name.append(reloIp);
                    name.append(" ");
                    name.append(reloNodeId);
                    name.append(" ");
                    name.append(reloNme);
                }
                table.addCell(ip);
                table.addCell(nodeId);
                table.addCell(name);