# How to sync data from htttp\_poller

**URL:** <https://discuss.elastic.co/t/how-to-sync-data-from-htttp-poller/320787>\
**Category:** Logstash\
**Created:** [December 8, 2022, 12:29pm UTC](https://discuss.elastic.co/t/how-to-sync-data-from-htttp-poller/320787 "2022-12-08T12:29:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rakhshunda\_Noorein\_J](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakhshunda_noorein_j/32/99407_2.png) [@Rakhshunda\_Noorein\_J](https://discuss.elastic.co/u/Rakhshunda_Noorein_J)\
**Post date:** [December 8, 2022, 12:29pm UTC](https://discuss.elastic.co/t/how-to-sync-data-from-htttp-poller/320787/1 "2022-12-08T12:29:18Z")

</div>

Hello,  
I am having 1 Billion data coming from an http API. The Api has pagination so that I can fetch data in batches. How can I implement that pagination in logstash using http\_poller plugin...  
My config file structure looks like this:

```auto
input {
  http_poller {
    urls => {
	api_url=> {
        method => "POST"
        url => "api url"
		headers => {
                    "Content-Type" => "application/json"
                }
        body=> '{"page":1 , "pagesize":20}'
      }
	}	
	request_timeout => 120
	schedule => {every => "1m"}
	codec => "json"
  }
}
   filter { 
	  mutate {
	  }
	}
output {
		elasticsearch {
			hosts => ["https://localhost:9200"]
			user => "---"
			password => "----"
			index => "my-index"
			document_id => "%{--}"
			doc_as_upsert => true
			action => "update"
		}
  stdout { codec => rubydebug }
}

```

I want to call this api multiple times with different page and pagesize parameters untill all the pages are reached.

---

<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:** [January 5, 2023, 12:30pm UTC](https://discuss.elastic.co/t/how-to-sync-data-from-htttp-poller/320787/2 "2023-01-05T12:30:09Z")

</div>

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