# Http\_request\_failure when trying to get logs with http\_poller plugin logstash

**URL:** <https://discuss.elastic.co/t/http-request-failure-when-trying-to-get-logs-with-http-poller-plugin-logstash/57134>\
**Category:** Logstash\
**Created:** [August 3, 2016, 4:49pm UTC](https://discuss.elastic.co/t/http-request-failure-when-trying-to-get-logs-with-http-poller-plugin-logstash/57134 "2016-08-03T16:49:43Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![bishaka](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@bishaka](https://discuss.elastic.co/u/bishaka)\
**Post date:** [August 3, 2016, 4:49pm UTC](https://discuss.elastic.co/t/http-request-failure-when-trying-to-get-logs-with-http-poller-plugin-logstash/57134/1 "2016-08-03T16:49:43Z")

</div>

Hi,  
I want to fetch JSON formatted logs from a URL. What is the best approach to do it? I tried the http\_poller plugin..but I am not sure if it doesn't work or i am doing something wrong. Can you please help?

I tried using the httppoll plugin in logstash...however,.. i get an http failure message

input {  
http\_poller {  
urls =\> {  
test1 =\> "[http://nimhts23.hm230.org/solr/col\_dashv1\_shard2\_replica2/select?q=%3A&wt=json&indent=true](http://nimhts23.hm230.org/solr/col_dashv1_shard2_replica2/select?q=%3A&wt=json&indent=true)"  
}

request\_timeout =\> 60  
interval =\> 60  
codec =\> "json"  
}  
}

output {  
elasticsearch {  
hosts =\> "10.45.31.897"

```
}

```

}

I get the following message:

@version:1 @timestamp:August 2nd 2016, 15:29:24.663 tags:httprequest\_failure http\_request\_failure.request.method:get http\_request\_failure.request.url:[http://nimhts23.hm230.org/solr/col\_dashv1\_shard2\_replica2/select?q=%3A&wt=json&indent=true](http://nimhts23.hm230.org/solr/col_dashv1_shard2_replica2/select?q=%3A&wt=json&indent=true) http\_request\_failure.name:test1 http\_request\_failure.error:nimhts23.hm230.org: unknown error http\_request\_failure.backtrace: - http\_request\_failure.runtime\_seconds:0.284 \_id:AVZNYEFVvm06ECqo53r0 \_type:logs \_index:logstash-2016.08.02 \_score:

---

<div class="post-metadata">

**Author:** ![bishaka](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@bishaka](https://discuss.elastic.co/u/bishaka)\
**Post date:** [August 3, 2016, 4:58pm UTC](https://discuss.elastic.co/t/http-request-failure-when-trying-to-get-logs-with-http-poller-plugin-logstash/57134/2 "2016-08-03T16:58:05Z")

</div>

I get this error message on stdout:

{  
"@version" =\> "1",  
"@timestamp" =\> "2016-08-03T16:55:40.437Z",  
"http\_poller\_metadata" =\> {  
"name" =\> "test2",  
"host" =\> "aunmo",  
"request" =\> {  
"method" =\> "get",  
"url" =\> "[http://nimhts23.hm230.org/solr/col\_dashv1\_shard2\_replica2/select?q=%3A&wt=json&indent=true](http://nimhts23.hm230.org/solr/col_dashv1_shard2_replica2/select?q=%3A&wt=json&indent=true)""  
},  
"runtime\_seconds" =\> nil  
},  
"tags" =\> [  
[0] "\_http\_request\_failure"  
],  
"http\_request\_failure" =\> {  
"request" =\> {  
"method" =\> "get",  
"url" =\> [http://nimhts23.hm230.org/solr/col\_dashv1\_shard2\_replica2/select?q=%3A&wt=json&indent=true](http://nimhts23.hm230.org/solr/col_dashv1_shard2_replica2/select?q=%3A&wt=json&indent=true)""  
},  
"name" =\> "test2",  
"error" =\> "[http://nimhts23.hm230.org](http://nimhts23.hm230.org): unknown error",  
"backtrace" =\> nil,  
"runtime\_seconds" =\> 0.776  
}  
}

---

<div class="post-metadata">

**Author:** ![bishaka](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@bishaka](https://discuss.elastic.co/u/bishaka)\
**Post date:** [August 4, 2016, 5:09pm UTC](https://discuss.elastic.co/t/http-request-failure-when-trying-to-get-logs-with-http-poller-plugin-logstash/57134/3 "2016-08-04T17:09:36Z")

</div>

Can someone help with this? I am still stuck on the same issue. constantly trying to debug this issue with no luck..

What could be there reason behind this http\_request\_failure?

---

<div class="post-metadata">

**Author:** ![bishaka](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@bishaka](https://discuss.elastic.co/u/bishaka)\
**Post date:** [August 5, 2016, 4:59pm UTC](https://discuss.elastic.co/t/http-request-failure-when-trying-to-get-logs-with-http-poller-plugin-logstash/57134/4 "2016-08-05T16:59:53Z")

</div>

@warkolm, Sorry about having to tag you on this. But I have been stuck with this for long time and can't figure out where the problem is. If you could provide some insights, i would greatly appreciate it!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 7, 2016, 9:41am UTC](https://discuss.elastic.co/t/http-request-failure-when-trying-to-get-logs-with-http-poller-plugin-logstash/57134/5 "2016-08-07T09:41:06Z")

</div>

Try removing the JSON codec in the input and output to stdout with ruby debug codec instead of Elasticsearch to see exactly what the fetched events look like to Logstash. Then add filters and codecs as appropriate.

---

<div class="post-metadata">

**Author:** ![bishaka](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@bishaka](https://discuss.elastic.co/u/bishaka)\
**Post date:** [August 8, 2016, 6:09pm UTC](https://discuss.elastic.co/t/http-request-failure-when-trying-to-get-logs-with-http-poller-plugin-logstash/57134/6 "2016-08-08T18:09:47Z")

</div>

Still same error...

{  
"@version" =\> "1",  
"@timestamp" =\> "2016-08-08T18:08:10.701Z",  
"report" =\> {  
"name" =\> "test2",  
"host" =\> "malibu",  
"request" =\> {  
"method" =\> "get",  
"url" =\> "confidential"  
},  
"runtime\_seconds" =\> nil  
},  
"tags" =\> [  
[0] "\_http\_request\_failure"  
],  
"http\_request\_failure" =\> {  
"request" =\> {  
"method" =\> "get",  
"url" =\> "confidential"  
},  
"name" =\> "test2",  
"error" =\> "confidential",  
"backtrace" =\> nil,  
"runtime\_seconds" =\> 0.003  
}  
}

I guess the http\_poller plugin is broken.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 8, 2016, 6:46pm UTC](https://discuss.elastic.co/t/http-request-failure-when-trying-to-get-logs-with-http-poller-plugin-logstash/57134/7 "2016-08-08T18:46:59Z")

</div>

Are you able to curl to the specified URL from the server where Logstash is running? What does this return?

---

<div class="post-metadata">

**Author:** ![bishaka](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@bishaka](https://discuss.elastic.co/u/bishaka)\
**Post date:** [August 8, 2016, 7:05pm UTC](https://discuss.elastic.co/t/http-request-failure-when-trying-to-get-logs-with-http-poller-plugin-logstash/57134/8 "2016-08-08T19:05:36Z")

</div>

I did ping "url"

and the response i get is:  
ping: unknown host myurl

So i guess it's a problem with the url..not the plugin?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 8, 2016, 7:34pm UTC](https://discuss.elastic.co/t/http-request-failure-when-trying-to-get-logs-with-http-poller-plugin-logstash/57134/9 "2016-08-08T19:34:45Z")

</div>

> [@bishaka](#):
>
> [http://nimhts23.hm230.org/solr/col\_dashv1\_shard2\_replica2/select?q=%3A&wt=json&indent=true](http://nimhts23.hm230.org/solr/col_dashv1_shard2_replica2/select?q=%3A&wt=json&indent=true)

Ping is for servers, not URLs, and it will not tell you whether you have connectivity to the appropriate port or not. Are you able to curl the URL quoted above?

---

<div class="post-metadata">

**Author:** ![bishaka](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@bishaka](https://discuss.elastic.co/u/bishaka)\
**Post date:** [August 8, 2016, 8:09pm UTC](https://discuss.elastic.co/t/http-request-failure-when-trying-to-get-logs-with-http-poller-plugin-logstash/57134/10 "2016-08-08T20:09:56Z")

</div>

Oh my bad. Silly me!  
I tried the curl command and I am getting "curl: (6) Couldn't resolve host '[hdpttn24.mmc1800.org](http://hdpttn24.mmc1800.org)'

---

<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:** [July 6, 2017, 4:44am UTC](https://discuss.elastic.co/t/http-request-failure-when-trying-to-get-logs-with-http-poller-plugin-logstash/57134/11 "2017-07-06T04:44:20Z")

</div>


