# Pagination for REST API Through Logstash

**URL:** https://discuss.elastic.co/t/pagination-for-rest-api-through-logstash/231060
**Category:** Logstash
**Created:** [May 5, 2020, 12:15am UTC](https://discuss.elastic.co/t/pagination-for-rest-api-through-logstash/231060 "2020-05-05T00:15:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Mahmmoud\_Rashed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahmmoud_rashed/32/67745_2.png) [@Mahmmoud\_Rashed](https://discuss.elastic.co/u/Mahmmoud_Rashed)
#### Post date: [May 5, 2020, 12:15am UTC](https://discuss.elastic.co/t/pagination-for-rest-api-through-logstash/231060/1 "2020-05-05T00:15:31Z")

</div>

How can I import from a REST API to Elasticsearch via Logstash using Pagination?

I was able to import using http\_poller but unfortunately, it doesn't support pagination, so how can I write force a custom script or "for loop" to check for other records to import, as each API call retrieves only 50 records and I have more than 100 K.

Please help how can I apply pagination logic here.

Thanks.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [May 5, 2020, 6:01am UTC](https://discuss.elastic.co/t/pagination-for-rest-api-through-logstash/231060/2 "2020-05-05T06:01:11Z")

</div>

I think there's an issue for support for that in the plugin repo, but it doesn't support it at this stage unfortunately.

---

<div class="post-metadata">

### Author: ![Mahmmoud\_Rashed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahmmoud_rashed/32/67745_2.png) [@Mahmmoud\_Rashed](https://discuss.elastic.co/u/Mahmmoud_Rashed)
#### Post date: [May 5, 2020, 5:29pm UTC](https://discuss.elastic.co/t/pagination-for-rest-api-through-logstash/231060/3 "2020-05-05T17:29:26Z")

</div>

Thank you Mark for your response.  
Is there any other way, if http\_poller doesn't support pagination. Like using exec command or any other plugin?

Regards

---

<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: [June 2, 2020, 5:29pm UTC](https://discuss.elastic.co/t/pagination-for-rest-api-through-logstash/231060/4 "2020-06-02T17:29:28Z")

</div>

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