# Issue with HTTP Poller when using headers - invalid url

**URL:** https://discuss.elastic.co/t/issue-with-http-poller-when-using-headers-invalid-url/201549
**Category:** Logstash
**Created:** [September 29, 2019, 11:44pm UTC](https://discuss.elastic.co/t/issue-with-http-poller-when-using-headers-invalid-url/201549 "2019-09-29T23:44:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Sketchy](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@Sketchy](https://discuss.elastic.co/u/Sketchy)
#### Post date: [September 29, 2019, 11:44pm UTC](https://discuss.elastic.co/t/issue-with-http-poller-when-using-headers-invalid-url/201549/1 "2019-09-29T23:44:05Z")

</div>

Having trouble getting http\_poller to work querying an API, as soon as I try adding headers it starts failing with Invalid URL without any other details as to why its failing. There is little documentation on using headers and even in debug mode I have trouble trying to work out why its failing.

```auto
input {
   http_poller {
         schedule => { every => "10s"}
         urls => { 
           myurl => "https://myurl.com/site/report/report.jsp?reportoption=csv&datefrom=TODAY&dateto=TODAY"
           headers => {
            Auth => "XXXXXXX"
            }
        }
   }
} 

```

I have tried many combinations of the headers section with no luck.

[ERROR] 2019-09-30 09:17:33.721 [[main]-pipeline-manager] javapipeline - Pipeline aborted due to error {:pipeline\_id=\>"main", :exception=\>#\<LogStash::ConfigurationError: Invalid URL \>, :backtrace=\>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-http\_poller-5.0.1/lib/logstash/inputs/http\_poller.rb:103:in `validate_request!'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-http_poller-5.0.1/lib/logstash/inputs/http_poller.rb:95:in`normalize\_request'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-http\_poller-5.0.1/lib/logstash/inputs/http\_poller.rb:55:in `block in setup_requests!'", "org/jruby/RubyHash.java:1419:in`each'", "org/jruby/RubyEnumerable.java:833:in `map'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-http_poller-5.0.1/lib/logstash/inputs/http_poller.rb:55:in`setup\_requests!'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-http\_poller-5.0.1/lib/logstash/inputs/http\_poller.rb:45:in `register'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:192:in`block in register\_plugins'", "org/jruby/RubyArray.java:1792:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:191:in`register\_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/java\_pipeline.rb:292:in `start_inputs'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:248:in`start\_workers'", "/usr/share/logstash/logstash-core/lib/logstash/java\_pipeline.rb:146:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:105:in`block in start'"], :thread=\>"#\<Thread:0xbef4677 run\>"}  
[ERROR] 2019-09-30 09:17:33.735 [Converge PipelineAction::Create] agent - Failed to execute action {:id=\>:main, :action\_type=\>LogStash::ConvergeResult::FailedAction, :message=\>"Could not execute action: PipelineAction::Create, action\_result: false", :backtrace=\>nil}

---

<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: [September 30, 2019, 1:56pm UTC](https://discuss.elastic.co/t/issue-with-http-poller-when-using-headers-invalid-url/201549/2 "2019-09-30T13:56:07Z")

</div>

> [@Sketchy](#):
>
> urls =\> { myurl =\> "[https://myurl.com/site/report/report.jsp?reportoption=csv&datefrom=TODAY&dateto=TODAY](https://myurl.com/site/report/report.jsp?reportoption=csv&datefrom=TODAY&dateto=TODAY)" headers =\> { Auth =\> "XXXXXXX" } }

I believe that should be

```
urls => {
    myurl => {
        url => "https://myurl.com/site/report/report.jsp?reportoption=csv&datefrom=TODAY&dateto=TODAY"
        headers => { Auth => "XXXXXXX" }
    }
}

```

---

<div class="post-metadata">

### Author: ![Sketchy](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@Sketchy](https://discuss.elastic.co/u/Sketchy)
#### Post date: [October 1, 2019, 3:41am UTC](https://discuss.elastic.co/t/issue-with-http-poller-when-using-headers-invalid-url/201549/3 "2019-10-01T03:41:50Z")

</div>

Thanks Badger that works, I must say the doco around using headers is ordinary at best but thanks for helping with the syntax.

---

<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: [October 29, 2019, 3:41am UTC](https://discuss.elastic.co/t/issue-with-http-poller-when-using-headers-invalid-url/201549/4 "2019-10-29T03:41:57Z")

</div>

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