[Filebeat][httpconf] AuthenticationMissingOrInvalid

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

Hi @Mohammed_Amine_El_ha,
Instead of using filebeat, please try the [http input plugin] (Http input plugin | Logstash Reference [8.9] | Elastic) in logstash. Among other things you'll be able to set the authentication settings more cleaning that way.

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