# Querying indices that match an index pattern

**URL:** <https://discuss.elastic.co/t/querying-indices-that-match-an-index-pattern/148212>\
**Category:** Elasticsearch\
**Created:** [September 11, 2018, 7:57pm UTC](https://discuss.elastic.co/t/querying-indices-that-match-an-index-pattern/148212 "2018-09-11T19:57:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dwiz](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dwiz](https://discuss.elastic.co/u/dwiz)\
**Post date:** [September 11, 2018, 7:57pm UTC](https://discuss.elastic.co/t/querying-indices-that-match-an-index-pattern/148212/1 "2018-09-11T19:57:12Z")

</div>

Trying to query all indices that match a given pattern, exact or partial (with \*). The aggregation on \_field doesn't work since that doesn't seem to match indices with no documents. And I looked into the \_cat/indices API which seems like it would work except I can't get it to limit the results to a reasonable amount. Specifying ?size=100 doesn't seem to do anything.

So questions are:

1. Is there a way to limit the # of indices coming back from the \_cat API
2. If not, is there another way that this would work?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 9, 2018, 7:57pm UTC](https://discuss.elastic.co/t/querying-indices-that-match-an-index-pattern/148212/2 "2018-10-09T19:57:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
