# Pagination for REST API Via Logstash

**URL:** https://discuss.elastic.co/t/pagination-for-rest-api-via-logstash/242714
**Category:** Logstash
**Created:** [July 27, 2020, 8:49am UTC](https://discuss.elastic.co/t/pagination-for-rest-api-via-logstash/242714 "2020-07-27T08:49:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hiba](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hiba/32/110919_2.png) [@hiba](https://discuss.elastic.co/u/hiba)
#### Post date: [July 27, 2020, 8:49am UTC](https://discuss.elastic.co/t/pagination-for-rest-api-via-logstash/242714/1 "2020-07-27T08:49:23Z")

</div>

Hi,

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

I was able to import using http\_poller, how can I write force a custom script or "for loop" to check for other records to import.  
Can someone give me an example!

I use ELK 7.7.0

Please help how can I apply pagination logic here.

Thanks

---

<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: [August 24, 2020, 8:49am UTC](https://discuss.elastic.co/t/pagination-for-rest-api-via-logstash/242714/2 "2020-08-24T08:49:27Z")

</div>

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