# How to use logstash-input-http-poller from zabbix api method?

**URL:** <https://discuss.elastic.co/t/how-to-use-logstash-input-http-poller-from-zabbix-api-method/203231>\
**Category:** Logstash\
**Created:** [October 11, 2019, 11:36am UTC](https://discuss.elastic.co/t/how-to-use-logstash-input-http-poller-from-zabbix-api-method/203231 "2019-10-11T11:36:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![uf012366](https://avatars.discourse-cdn.com/v4/letter/u/90db22/32.png) [@uf012366](https://discuss.elastic.co/u/uf012366)\
**Post date:** [October 11, 2019, 11:36am UTC](https://discuss.elastic.co/t/how-to-use-logstash-input-http-poller-from-zabbix-api-method/203231/1 "2019-10-11T11:36:28Z")

</div>

i try use Http\_poller input plugin loading Zabbix data, but cannot use ZABBIX api method loading data.

how to use zabbix jsonrpc api method in the logstash Http\_poller input plugin ????  
Are there any cases in this regard?

my logstash confiure, but logstash rufus-scheduler intercepted an error  
input {  
http\_poller {  
#interval =\> 15  
codec =\> "json"  
urls =\> {  
zab =\> {  
url =\> "[http://ntmp.eoss.bba/zabbix/api\_jsonrpc.php](http://ntmp.eoss.bba/zabbix/api_jsonrpc.php)"  
method =\> post  
headers =\> {  
"content-type" =\> "application/json"  
}  
body =\> {  
jsonrpc =\> "2.0"  
method =\> "apiinfo.version"  
params =\> {  
user =\> "v0002715"  
password =\> "8ik,&UJMjk"  
}  
id =\> 1  
}  
#auth =\> null  
}  
}  
request\_timeout =\> 60  
schedule =\> { cron =\> "\* \* \* \* \* UTC"}  
}  
}

output {  
stdout { codec =\> rubydebug }  
}

error info  
{ 2012 rufus-scheduler intercepted an error:  
2012 job:  
2012 Rufus::Scheduler::CronJob "\* \* \* \* \* UTC" {}  
2012 error:  
2012 2012  
2012 NoMethodError  
2012 undefined method `encoding' for #Hash:0x2cbae460

---

<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 11, 2019, 3:11pm UTC](https://discuss.elastic.co/t/how-to-use-logstash-input-http-poller-from-zabbix-api-method/203231/2 "2019-10-11T15:11:13Z")

</div>

> [@uf012366](#):
>
> undefined method `encoding'

I am not sure, but I think the [code](https://github.com/cheald/manticore/blob/5a2fb766cb6f96ff7b1082381d65f15f6235dbb5/lib/manticore/client.rb#L468) expects the body option to be a string, not a hash.

---

<div class="post-metadata">

**Author:** ![uf012366](https://avatars.discourse-cdn.com/v4/letter/u/90db22/32.png) [@uf012366](https://discuss.elastic.co/u/uf012366)\
**Post date:** [October 12, 2019, 1:42am UTC](https://discuss.elastic.co/t/how-to-use-logstash-input-http-poller-from-zabbix-api-method/203231/3 "2019-10-12T01:42:52Z")

</div>

how to change code type in the input body option?

---

<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, 2019, 1:43am UTC](https://discuss.elastic.co/t/how-to-use-logstash-input-http-poller-from-zabbix-api-method/203231/4 "2019-11-09T01:43:01Z")

</div>

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