Input http dont know service

[2017-01-27T20:34:31,943][ERROR][logstash.agent ] Pipeline aborted due to error {:exception=>#<SocketError: initialize: name or service not known>, :backtrace=>["org/jruby/ext/socket/RubyTCPServer.java:115:in initialize'", "org/jruby/RubyIO.java:871:innew'", "/usr/share/logstash-5.1.2/vendor/bundle/jruby/1.9/gems/puma-2.16.0-java/lib/puma/binder.rb:234:in add_tcp_listener'", "(eval):2:inadd_tcp_listener'", "/usr/share/logstash-5.1.2/vendor/bundle/jruby/1.9/gems/logstash-input-http-3.0.3/lib/logstash/inputs/http.rb:120:in register'", "/usr/share/logstash-5.1.2/logstash-core/lib/logstash/pipeline.rb:353:instart_inputs'", "org/jruby/RubyArray.java:1613:in each'", "/usr/share/logstash-5.1.2/logstash-core/lib/logstash/pipeline.rb:352:instart_inputs'", "/usr/share/logstash-5.1.2/logstash-core/lib/logstash/pipeline.rb:228:in start_workers'", "/usr/share/logstash-5.1.2/logstash-core/lib/logstash/pipeline.rb:183:inrun'", "/usr/share/logstash-5.1.2/logstash-core/lib/logstash/agent.rb:292:in `start_pipeline'"]}

my script

input {

http {
host => "http://agromet.inia.cl/api/emas/"
user => "testing"
}
}

output {

stdout {}
}

browser
http://agromet.inia.cl/api/emas/?user=absd xxxxx
Answer :
{"emas":[{"id":"136","nombre":"Santa Amada","comuna":"Linares","provincia":"Linares","region":"Maule","latitud":"-35.760761","longitud":"-71.574215","elevacion":"150"}]}

Please any help
Thanks
Luis

The http input plugin acts as a server and processes incoming requests. It looks like you might be looking for the http poller plugin, which is able to periodically collect data from HTTP endpoints.

Thanks Christian,
I was using http_poller thus :

input {
http_poller {
urls => {
test0 => "http://agromet.inia.cl/api/emas/?user=adbdb1ef0dca1ad"
#test1 => {
# Supports all options supported by ruby's Manticore HTTP client
#method => "get"
#url => "http://agromet.inia.cl/api/emas/"
#auth => {
# user => "adbdb1ef0dca1ad"
# password => ""
#}
#}
}
request_timeout => 60
# Supports "cron", "every", "at" and "in" schedules by rufus scheduler
schedule => { cron => "* * * * * UTC"}
codec => "json"
# A hash of request metadata info (timing, response headers, etc.) will be sent here
#metadata_target => "http_poller_metadata"
}
}
Only is working Test0, Test1 connect but no return data.
I think Test1 must be run because both are doing the same or not?
Regards & thanks again
Luis

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