# Transfer json format data from external service to elasticseach

**URL:** https://discuss.elastic.co/t/transfer-json-format-data-from-external-service-to-elasticseach/204464
**Category:** Logstash
**Created:** [October 21, 2019, 12:16pm UTC](https://discuss.elastic.co/t/transfer-json-format-data-from-external-service-to-elasticseach/204464 "2019-10-21T12:16:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![namali](https://avatars.discourse-cdn.com/v4/letter/n/a87d85/32.png) [@namali](https://discuss.elastic.co/u/namali)
#### Post date: [October 21, 2019, 12:16pm UTC](https://discuss.elastic.co/t/transfer-json-format-data-from-external-service-to-elasticseach/204464/1 "2019-10-21T12:16:41Z")

</div>

trying to transfer data in json format which in external service to elasticseach.  
data provide page by page. next page define in previous page  
how to transfer data from all pages to elasticseach

sample json file

count: 565946  
next: "[http://test.data.tech/api/static/v1/hotels/?format=json&page=2](http://test.data.tech/api/static/v1/hotels/?format=json&page=2)"  
previous: "null"  
results   
0: {…}  
1:   
address: "Keizersgracht 164"  
availability\_score: 0.000837698434291508  
book\_score: 501  
checkin\_from: "14:00"

used http\_poller input plugin but it transfer only data in first page.

input {  
http\_poller {  
urls =\> {

```
  test2 => {
    method => GET 
    user => "xxxx"
    password => "xxxx"
    url => "http://test.data.tech/api/static/v1/hotels"
   
 }
}
request_timeout => 60
schedule => { cron => "* * * * * UTC"}
codec => "json"

```

}

}

Is there way to transfer data in all pages to a index

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [October 21, 2019, 1:15pm UTC](https://discuss.elastic.co/t/transfer-json-format-data-from-external-service-to-elasticseach/204464/2 "2019-10-21T13:15:40Z")

</div>

You could write a [script file](https://www.elastic.co/guide/en/logstash/current/plugins-filters-ruby.html#_using_a_ruby_script_file) for a ruby filter which walks down a chain of linked pages and returned an array of events, but to be honest this use case is not a good fit for logstash.

---

<div class="post-metadata">

### Author: ![namali](https://avatars.discourse-cdn.com/v4/letter/n/a87d85/32.png) [@namali](https://discuss.elastic.co/u/namali)
#### Post date: [October 22, 2019, 5:54am UTC](https://discuss.elastic.co/t/transfer-json-format-data-from-external-service-to-elasticseach/204464/3 "2019-10-22T05:54:38Z")

</div>

Thanks for the guide. by the way are there any other methods to do this.

---

<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: [November 19, 2019, 5:54am UTC](https://discuss.elastic.co/t/transfer-json-format-data-from-external-service-to-elasticseach/204464/4 "2019-11-19T05:54:38Z")

</div>

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