# Using response http\_poller

**URL:** https://discuss.elastic.co/t/using-response-http-poller/103668
**Category:** Logstash
**Created:** [October 12, 2017, 7:39am UTC](https://discuss.elastic.co/t/using-response-http-poller/103668 "2017-10-12T07:39:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![abrejuin](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@abrejuin](https://discuss.elastic.co/u/abrejuin)
#### Post date: [October 12, 2017, 7:39am UTC](https://discuss.elastic.co/t/using-response-http-poller/103668/1 "2017-10-12T07:39:00Z")

</div>

Hello,

I want to be able to add some information to Elastic from an API using http\_poller.  
I began with this :  
input {  
http\_poller {  
urls =\> {  
"test" =\> {  
method =\> get  
url =\> "[https://dashboard.meraki.com/api/v0/organizations/XXXXXX/networks](https://dashboard.meraki.com/api/v0/organizations/XXXXXX/networks)"  
headers =\> {  
Accept =\> "application/json"  
"x-cisco-meraki-api-key" =\> "ENTER API KEY"  
}  
}  
}  
request\_timeout =\> 60  
interval =\> 60  
codec =\> "json"  
}  
}

Then I get a list of results with an network id for each.  
{  
"organizationId" =\> "XXXXXX",  
"@timestamp" =\> 2017-10-12T07:34:20.053Z,  
"name" =\> "AAAAAAAAAAAAA ",  
"@version" =\> "1",  
"timeZone" =\> "Europe/Paris",  
"id" =\> "N\_XXXXXXXXXXXX",  
"type" =\> "appliance",  
"tags" =\> " APPLIANCE "  
}  
I want to send another get method using all network ids previously received, something like  
url =\> "[https://dashboard.meraki.com/api/v0/organizations/XXXXXX/networks/N\_XXXXXXXXX](https://dashboard.meraki.com/api/v0/organizations/XXXXXX/networks/N_XXXXXXXXX)"  
with a loop.

Is it possible to do this such of thing ?  
If so, could you help me to do it please ?

Thanks a lot  
Antoine

---

<div class="post-metadata">

### Author: ![abrejuin](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@abrejuin](https://discuss.elastic.co/u/abrejuin)
#### Post date: [October 12, 2017, 1:20pm UTC](https://discuss.elastic.co/t/using-response-http-poller/103668/2 "2017-10-12T13:20:41Z")

</div>

I tried to save url in a variable and then call url with the variable and it is not working.

add\_field =\> { "urlnetwork" =\> "[https://dashboard.meraki.com/api/v0/organizations/XXXXXX/networks](https://dashboard.meraki.com/api/v0/organizations/XXXXXX/networks)" }  
add\_field =\> { "urldevice" =\> "%{urlnetwork}/%{networkId}/devices"}

urls =\> {  
"meraki\_networkDevices" =\> {  
method =\> get  
url =\> "%{urldevice}"  
}  
}

Thanks a lot  
Antoine

---

<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 9, 2017, 1:20pm UTC](https://discuss.elastic.co/t/using-response-http-poller/103668/3 "2017-11-09T13:20:44Z")

</div>

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