# \[Filebeat\]\[httpconf\] AuthenticationMissingOrInvalid

**URL:** <https://discuss.elastic.co/t/filebeat-httpconf-authenticationmissingorinvalid/340269>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [August 7, 2023, 12:20pm UTC](https://discuss.elastic.co/t/filebeat-httpconf-authenticationmissingorinvalid/340269 "2023-08-07T12:20:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammed\_Amine\_El\_ha](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@Mohammed\_Amine\_El\_ha](https://discuss.elastic.co/u/Mohammed_Amine_El_ha)\
**Post date:** [August 7, 2023, 12:20pm UTC](https://discuss.elastic.co/t/filebeat-httpconf-authenticationmissingorinvalid/340269/1 "2023-08-07T12:20:54Z")

</div>

Hi,  
I need to get logs from a rest API, I tried this config in My filebeat.yml:

filebeat.inputs:

- type: httpjson  
request.url: ----------------------------------  
request.transforms:
  - set:  
target: header.Authorization  
value: '"Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX='

When testing the URI with basic authentication using other toolsn I get the logs I'm looking for.  
But when running Filebeat , I get this:

{"log.level":"error","@timestamp":"2023-08-07T12:50:44.763+0100","log.logger":"input.httpjson-stateless","log.origin":{"file.name":"httpjson/input.go","file.line":143},"message":"Error while processing http request: failed to execute rf.collectResponse: failed to execute http client.Do: server responded with status code 401: {"code":"AuthenticationMissingOrInvalid","message":"The credential is missing or invalid."}\n","service.name":"filebeat","id":"7AFEB288B5C44402","input\_url":"--------------------------","ecs.version":"1.6.0"}

I don't know what the problem is.  
Pleqse help me

---

<div class="post-metadata">

**Author:** ![Wave](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wave/32/117242_2.png) [@Wave](https://discuss.elastic.co/u/Wave)\
**Post date:** [August 11, 2023, 6:35pm UTC](https://discuss.elastic.co/t/filebeat-httpconf-authenticationmissingorinvalid/340269/2 "2023-08-11T18:35:36Z")

</div>

Hi @Mohammed_Amine_El_ha,  
Instead of using filebeat, please try the [http input plugin] ([Http input plugin | Logstash Reference [8.9] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http.html)) in logstash. Among other things you'll be able to set the authentication settings more cleaning that way.

---

<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:** [September 8, 2023, 8:36pm UTC](https://discuss.elastic.co/t/filebeat-httpconf-authenticationmissingorinvalid/340269/3 "2023-09-08T20:36:15Z")

</div>

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