# MetricBeat Failing on ElasticSearch AWS Instance - Unauthorized - Authentication required

**URL:** https://discuss.elastic.co/t/metricbeat-failing-on-elasticsearch-aws-instance-unauthorized-authentication-required/265306
**Category:** Beats
**Tags:** metricbeat
**Created:** [February 24, 2021, 9:35am UTC](https://discuss.elastic.co/t/metricbeat-failing-on-elasticsearch-aws-instance-unauthorized-authentication-required/265306 "2021-02-24T09:35:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gr33nberet](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@gr33nberet](https://discuss.elastic.co/u/gr33nberet)
#### Post date: [February 24, 2021, 9:35am UTC](https://discuss.elastic.co/t/metricbeat-failing-on-elasticsearch-aws-instance-unauthorized-authentication-required/265306/1 "2021-02-24T09:35:24Z")

</div>

Hello everyone,

I'm having issues setting up MetricBeat on AWS ES Instance, I'm getting the following error :

```auto
ERROR instance/beat.go:971 Exiting: 1 error: error loading index pattern: returned 401 to import file: <nil>. Response: {"statusCode":401,"error":"Unauthorized","message":"Authentication required"}

Exiting: 1 error: error loading index pattern: returned 401 to import file: <nil>. Response: {"statusCode":401,"error":"Unauthorized","message":"Authentication required"}

```

These are my metricbeat.yml settings

```auto
output.elasticsearch:
  hosts: ["https://search-xxxxxx.us-east-1.es.amazonaws.com:443"]
  username: "user"
  password: "password"

setup.ilm.enabled: false

setup.kibana:
  host: "https://search-xxxxxx.us-east-1.es.amazonaws.com:443/_plugin/kibana/"

```

Everything works fine when I set this up on the cloud instance using the cloud id and cloud auth. It also works fine using the logstash settings from the AWS documentation, I can properly PUT data via CURL but not with metricbeat / Filebeat.

Any help will be really appreciated.

---

<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: [March 24, 2021, 11:36am UTC](https://discuss.elastic.co/t/metricbeat-failing-on-elasticsearch-aws-instance-unauthorized-authentication-required/265306/2 "2021-03-24T11:36:23Z")

</div>

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