# Http\_poller input plugin: connect\_timeout ignored

**URL:** <https://discuss.elastic.co/t/http-poller-input-plugin-connect-timeout-ignored/54738>\
**Category:** Logstash\
**Created:** [July 5, 2016, 2:02pm UTC](https://discuss.elastic.co/t/http-poller-input-plugin-connect-timeout-ignored/54738 "2016-07-05T14:02:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mguiwin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mguiwin/32/6743_2.png) [@mguiwin](https://discuss.elastic.co/u/mguiwin)\
**Post date:** [July 5, 2016, 2:02pm UTC](https://discuss.elastic.co/t/http-poller-input-plugin-connect-timeout-ignored/54738/1 "2016-07-05T14:02:11Z")

</div>

Hi,

It seems like the [**http\_poller input plugin**](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http_poller.html#plugins-inputs-http_poller-connect_timeout) ignores the **connect\_timeout** setting.

Using:  
**logstash 2.3.2**  
**logstash-input-http\_poller 2.0.6**

Here is my http\_poller conf:

```
input {
  http_poller {
    urls => {
      metric_healthcheck => "https://www.example.com/healthcheck.php"
    }
    interval => 5
    connect_timeout => 5
    request_timeout => 5
    keepalive => false
    codec => "json"
 }

  http_poller {
    urls => {
       metric_counters => "https://www.example.com/counters.php"
    }
    interval => 60
    connect_timeout => 30
    request_timeout => 30
    keepalive => false
    codec => "json"
  }
}

```

Simulating a long response on any of the tested URLs always ends up with a timeout of 10 seconds (which is the default for connect\_timeout setting).

Also, as can be seen in Logstash logs, the timeout is set to 'nil':

```
/var/log/logstash/logstash.log:{[...] :message=>"Registering http_poller Input" [...] :interval=>60, :timeout=>nil, :level=>:info}
/var/log/logstash/logstash.log:{[...] :message=>"Registering http_poller Input" [...] :interval=>5, :timeout=>nil, :level=>:info}

```

Is it a bug?

Thanks  
MG

---

<div class="post-metadata">

**Author:** ![mguiwin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mguiwin/32/6743_2.png) [@mguiwin](https://discuss.elastic.co/u/mguiwin)\
**Post date:** [July 5, 2016, 3:06pm UTC](https://discuss.elastic.co/t/http-poller-input-plugin-connect-timeout-ignored/54738/2 "2016-07-05T15:06:28Z")

</div>

After checking the source code of the underlying component **logstash-mixin-http\_client** , I've found the following _undocumented_ configuration setting: `socket_timeout`

So I set it in the **http\_poller** configuration file (`socket_timeout => 30`), and forced the target test page to simulate a long response (using PHP function `sleep(60);`), and it worked as expected!

So maybe the[http\_poller documentation page](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http_poller.html) is not up to date...

---

<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:49am UTC](https://discuss.elastic.co/t/http-poller-input-plugin-connect-timeout-ignored/54738/3 "2017-07-06T04:49:26Z")

</div>


