# Elastic Search API queries for index logs

**URL:** https://discuss.elastic.co/t/elastic-search-api-queries-for-index-logs/249635
**Category:** Elasticsearch
**Tags:** elastic-agent
**Created:** [September 23, 2020, 10:07am UTC](https://discuss.elastic.co/t/elastic-search-api-queries-for-index-logs/249635 "2020-09-23T10:07:32Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Anand\_219](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anand_219/32/46143_2.png) [@Anand\_219](https://discuss.elastic.co/u/Anand_219)
#### Post date: [September 23, 2020, 10:07am UTC](https://discuss.elastic.co/t/elastic-search-api-queries-for-index-logs/249635/1 "2020-09-23T10:07:32Z")

</div>

We are using EFK as log management for our application. I am playing with API of elastic search, while doing this I have few queries to get clarify.

**localhost:9200/\_cat/indices?bytes=b&s=store.size:desc&v**  
getting output with index with storage values.

health status index uuid pri rep docs.count docs.deleted store.size pri.store.size  
green open logstash-2020.03.12 fzXE4jkNRVuR1vY8gsH1Wg 5 1 5238124 0 4338693519 2166930857  
green open logstash-2020.06.18 ZceKU56oR8KyeGi3KnkvnQ 5 1 1271373 0 1697783610 846840406  
green open logstash-2020.06.14 eRaq5zD1SjC8hK4XaxzQ0Q 5 1 1827761 0 1587567406 793896413  
green open logstash-2020.06.17 oKwkLkO\_S\_ePoQGQw4wZRQ 5 1 1087704 0 1400759550 700349818

How extract the each index?  
\*\*I am using with curl request below \*\*  
**localhost:9200/logstash-2020.06.14/\_search**

But i am not able to getting the full data which it is actually stored in index **"logstash-2020.06.14"** ,

**Is there any way to GET the index data?**

---

<div class="post-metadata">

### Author: ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)
#### Post date: [September 23, 2020, 10:39am UTC](https://discuss.elastic.co/t/elastic-search-api-queries-for-index-logs/249635/2 "2020-09-23T10:39:24Z")

</div>

By default you will get only 10 documents  
you can supply size parameter to retrieve more  
**localhost:9200/logstash-2020.06.14/\_search?size=100**

---

<div class="post-metadata">

### Author: ![Anand\_219](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anand_219/32/46143_2.png) [@Anand\_219](https://discuss.elastic.co/u/Anand_219)
#### Post date: [September 23, 2020, 10:56am UTC](https://discuss.elastic.co/t/elastic-search-api-queries-for-index-logs/249635/3 "2020-09-23T10:56:04Z")

</div>

@ylasri Thanks for your response.  
Now understand to get this data, kindly share any links if you have any for more optimization with dates or size i can use it API and also for my research.

---

<div class="post-metadata">

### Author: ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)
#### Post date: [September 23, 2020, 11:04am UTC](https://discuss.elastic.co/t/elastic-search-api-queries-for-index-logs/249635/4 "2020-09-23T11:04:29Z")

</div>

Check these link that may help :  
[pagination](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/paginate-search-results.html)  
[scoll](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/paginate-search-results.html#scroll-search-results)

---

<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 21, 2020, 11:04am UTC](https://discuss.elastic.co/t/elastic-search-api-queries-for-index-logs/249635/5 "2020-10-21T11:04:31Z")

</div>

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