# Http\_poller input fails authentication

**URL:** https://discuss.elastic.co/t/http-poller-input-fails-authentication/364429
**Category:** Logstash
**Created:** [August 6, 2024, 1:41am UTC](https://discuss.elastic.co/t/http-poller-input-fails-authentication/364429 "2024-08-06T01:41:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Wilks](https://avatars.discourse-cdn.com/v4/letter/w/f475e1/32.png) [@Wilks](https://discuss.elastic.co/u/Wilks)
#### Post date: [August 6, 2024, 1:41am UTC](https://discuss.elastic.co/t/http-poller-input-fails-authentication/364429/1 "2024-08-06T01:41:10Z")

</div>

Hi,  
I am trying to get logstash to produce the same output as the following curl command that connects to a test server's REST API but it is always failing authentication.

curl -H "X-API-KEY: api\_key\_id" -H "X-SECRET: api\_key\_value" [http://localhost:5000/items](http://localhost:5000/items)

 ![Screenshot 2024-08-05 at 9.21.31 PM](https://us1.discourse-cdn.com/elastic/original/3X/b/4/b4328b9a8bd9cfebd435d9403c2bb389f94be137.png)

My logstash filter is as follows:

```auto
input {
  http_poller {
    schedule => { cron => "* * * * * UTC" }
    urls => {
      my_url => {
        method => get
        url => "http://localhost:5000/items"
        headers => {
	     "x-api-key" => "api_key_id"
         "x-api-secret" => "api_key_value"
         "Content-Type" => "application/json"
        }
        request_timeout => 60
      }
    }
    # Other input configurations...
  }
}

filter {
  # Add your filters here if needed
}

output {
  stdout {
    codec => rubydebug
  }
}

```

it produces the following error thats coming from the test server

 ![Screenshot 2024-08-05 at 9.25.34 PM](https://us1.discourse-cdn.com/elastic/original/3X/e/4/e474fac3934c401c0f22e1b65803e56a9a008e4e.png)

 ![Screenshot 2024-08-05 at 9.47.17 PM](https://us1.discourse-cdn.com/elastic/original/3X/a/e/ae424fa931fb47dbae9b7a2c35523b4dd7ebaed3.png)

I have tried using basic authentication but it fails as well.

```auto
api_key => "<api_key_id>:<api_key_value>

```

AND

```auto
auth => {
	     user => "api_key_id"
	     password => "api_key_value"
                }

```

I feel like it something simple that being overlooked here.

---

<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: [August 6, 2024, 1:56am UTC](https://discuss.elastic.co/t/http-poller-input-fails-authentication/364429/2 "2024-08-06T01:56:15Z")

</div>

Your curl command has X-API-KEY and X-SECRET, your poller has x-api-key and x-api-secret. Surely they should be consistent.
