Logstash http poller "_http_request_failure" : The server failed to respond with a valid HTTP response

I have a http page that returns JSON data. If you enter the link in browser, it will just show data in JSON format.

I used this web link in logstash http poller conf. However, execution gives error -
{
"@version" => "1",
"tags" => [
[0] "_http_request_failure"
],
"http_request_failure" => {
"error" => "The server failed to respond with a valid HTTP response",
"request" => {
"headers" => {
"Accept" => "application/json"
},
"method" => "get",
"url" => "http_link"
},
"name" => "test1",
"backtrace" => nil,
"runtime_seconds" => 0.235865
},
"@timestamp" => 2018-08-24T13:49:00.531Z
}

CONF -
input {
http_poller {
urls => {
test1 => {
method => get
url => "http_link"
headers => {
Accept => "application/json"
}
}
}
schedule => { cron => "* * * * * UTC"}
"codec" => "json_lines"
}
}
output {
#elasticsearch {

"codec" => "json"

"hosts" => ["localhost:9200"]

"index" => "lpardata"

#}
stdout {
"codec" => "rubydebug"
}
}

  1. I have validated the JSON format and it is valid.
  2. curl -X GET http_link gives the JSON response as I see in the browser.

Please suggest.

Regards,
Harish

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