How to use http_poller to poll REST API with multiple inputs


(Chuan Ydnk) #1

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 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 :frowning:
input {
http_poller {
urls => {
test1 => {
url => "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
}
}


(system) #2

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