# How to use http\_poller to poll REST API with multiple inputs

**URL:** <https://discuss.elastic.co/t/how-to-use-http-poller-to-poll-rest-api-with-multiple-inputs/155980>\
**Category:** Logstash\
**Created:** [November 9, 2018, 5:59am UTC](https://discuss.elastic.co/t/how-to-use-http-poller-to-poll-rest-api-with-multiple-inputs/155980 "2018-11-09T05:59:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chuan\_Ydnk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chuan_ydnk/32/37429_2.png) [@Chuan\_Ydnk](https://discuss.elastic.co/u/Chuan_Ydnk)\
**Post date:** [November 9, 2018, 5:59am UTC](https://discuss.elastic.co/t/how-to-use-http-poller-to-poll-rest-api-with-multiple-inputs/155980/1 "2018-11-09T05:59:50Z")

</div>

Hi Guys,

I am newbie to logstashs, kibana and elk. Hence, I wanted to use http\_poller to periodically get data from the this REST API [https://1.2.3.4/rest/dmiquery/getDMIData3](https://1.2.3.4/rest/dmiquery/getDMIData3) using POST method with JSON inputs as below

{"appId": "CVENT","viewId": "TfcOnLink","dataSourceId": "ALL\_AGGR","dimensionIds": ["msrPoint4Cust","msrPoint"],"metricIds": ["BTO","BCS","BSC"],"dimFilters": [["msrPoint4Cust","_WAN_",false]],"metricFilters": ,"sort": ,"top": 1000,"resolution": "r","timePeriod": "p","numberOfPeriods": 1}

Anyone able to advise how should the http\_poller conf look ? below is mine, but there's error in logstash log which dosen't make any sense to me ☹  
input {  
http\_poller {  
urls =\> {  
test1 =\> {  
url =\> "[https://wecacascxv01.assurance.sita.aero/rest/dmiquery/getDataViews](https://wecacascxv01.assurance.sita.aero/rest/dmiquery/getDataViews)"  
method =\> post  
user =\> "XXXXX"  
password =\> "XXXXX"  
headers =\> {  
Accept =\> "application/json"  
}  
body =\> '{"appId": "CVENT","viewId": "TfcOnLink","dataSourceId": "ALL\_AGGR","dimensionIds": ["msrPoint4Cust"],"metricIds": ["BTO"],"dimFilters": ,"metricFilters": [["BTO","\>",10000000,1]],"sort": ,"top": 1000,"resolution": "r","timePeriod": "p","numberOfPeriods": 1}'  
}  
}  
request\_timeout =\> 60  
# Supports "cron", "every", "at" and "in" schedules by rufus scheduler  
schedule =\> { cron =\> "\*/5 \* \* \* \* UTC"}  
codec =\> "json"  
# A hash of request metadata info (timing, response headers, etc.) will be sent here  
metadata\_target =\> "http\_poller\_metadata"  
}  
}

output {  
file {  
path =\> /tmp/debug  
}  
}

---

<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:** [December 7, 2018, 6:00am UTC](https://discuss.elastic.co/t/how-to-use-http-poller-to-poll-rest-api-with-multiple-inputs/155980/2 "2018-12-07T06:00:02Z")

</div>

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