# Elasticsearch error: missing authentication credentials for REST request \[/logstash-filebeat-2020.12.11/\_mapping\]

**URL:** <https://discuss.elastic.co/t/elasticsearch-error-missing-authentication-credentials-for-rest-request-logstash-filebeat-2020-12-11-mapping/258435>\
**Category:** Logstash\
**Created:** [December 11, 2020, 4:32pm UTC](https://discuss.elastic.co/t/elasticsearch-error-missing-authentication-credentials-for-rest-request-logstash-filebeat-2020-12-11-mapping/258435 "2020-12-11T16:32:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjcammilleri](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@mjcammilleri](https://discuss.elastic.co/u/mjcammilleri)\
**Post date:** [December 11, 2020, 4:32pm UTC](https://discuss.elastic.co/t/elasticsearch-error-missing-authentication-credentials-for-rest-request-logstash-filebeat-2020-12-11-mapping/258435/1 "2020-12-11T16:32:56Z")

</div>

Hi Everyone,

This could be an issue that crosses with Grafana, but I'm hoping for some insight here. I am able to access the Elasticsearch API using my active token. I can test using curl in various python scripts to pull information and all is good.

Now I'm trying to do some log annotations in our Prometheus/Grafana environment and I'd like to simply pull some log lines from Elasticsearch. I use the Elasticsearch data source and I set our index name, and pass the 'Authorization' header with my token as 'apiKey dfjahsdfi2389yufwhuh3928fh...', etc. I get a failure to connect with the error:

```auto
Elasticsearch error: missing authentication credentials for REST request [/logstash-filebeat-2020.12.11/_mapping

```

Why can I use curl with my api token just fine, but cannot use the api token to connect via Grafana's Elasticsearch data source? Is there another HTTP header I need to pass that I'm not currently?

The only debug log entry I can find in Grafana is:

```auto
t=2020-12-11T10:17:41-0600 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/18/logstash-filebeat-2020.12.11/_mapping status=401 remote_addr=XXX.XXX.XX.X time_ms=7 size=241 referer=http://grafanaserver.this.domain:3000/datasources/edit/18/

```

Apologies if this is outside of Elasticsearch, but since my API token is active, I cant imagine why there's an issue.

---

<div class="post-metadata">

**Author:** ![mjcammilleri](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@mjcammilleri](https://discuss.elastic.co/u/mjcammilleri)\
**Post date:** [December 14, 2020, 8:21pm UTC](https://discuss.elastic.co/t/elasticsearch-error-missing-authentication-credentials-for-rest-request-logstash-filebeat-2020-12-11-mapping/258435/2 "2020-12-14T20:21:37Z")

</div>

Delete. Bad copy/paste of API token. Check your buffers.

---

<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:** [January 11, 2021, 8:21pm UTC](https://discuss.elastic.co/t/elasticsearch-error-missing-authentication-credentials-for-rest-request-logstash-filebeat-2020-12-11-mapping/258435/3 "2021-01-11T20:21:58Z")

</div>

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