# HTTP error 401 in node: 401 Unauthorized

**URL:** <https://discuss.elastic.co/t/http-error-401-in-node-401-unauthorized/132532>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [May 18, 2018, 7:25pm UTC](https://discuss.elastic.co/t/http-error-401-in-node-401-unauthorized/132532 "2018-05-18T19:25:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tgdesrochers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tgdesrochers/32/51322_2.png) [@tgdesrochers](https://discuss.elastic.co/u/tgdesrochers)\
**Post date:** [May 18, 2018, 7:25pm UTC](https://discuss.elastic.co/t/http-error-401-in-node-401-unauthorized/132532/1 "2018-05-18T19:25:27Z")

</div>

Elastic 6.1.1  
Metricbeat 6.2.2

I have metricbeat on an elasticsearch server and when I check kibana all I see are errors:

```auto
HTTP error 401 in node: 401 Unauthorized

```

When I view the logs I don't see anything to indicate the API cannot be reached and the rest of the logs populate just fine.

My module is configured as:

```auto
#------------------------------ Elasticsearch ------------------------------#
metricbeat.modules:
- module: elasticsearch
  metricsets: ["node", "node_stats"]
  period: 10s
  hosts: ["localhost:9200"]

```

When I use the credentials in the output block everything works. And since the system metric logs make it it appears that I can auth to elasticsearch for bulk indexing. Do I need to specify creds in the module? I do have xpack enabled.

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [May 18, 2018, 8:34pm UTC](https://discuss.elastic.co/t/http-error-401-in-node-401-unauthorized/132532/2 "2018-05-18T20:34:28Z")

</div>

If you X-Pack security enabled then you'll need to configure the module with the appropriate credentials and/or TLS settings.

```auto
metricbeat.modules:
- module: elasticsearch
  metricsets: ["node", "node_stats"]
  period: 10s
  hosts: ["localhost:9200"]
  username: user
  password: secret

```

---

<div class="post-metadata">

**Author:** ![tgdesrochers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tgdesrochers/32/51322_2.png) [@tgdesrochers](https://discuss.elastic.co/u/tgdesrochers)\
**Post date:** [May 18, 2018, 8:58pm UTC](https://discuss.elastic.co/t/http-error-401-in-node-401-unauthorized/132532/3 "2018-05-18T20:58:15Z")

</div>

Thank you. The documentation and example yml file didn't specify. I appreciate the I fo. I'll put it there and test. It would be nice if it could inherit the info from the output.

---

<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:** [June 15, 2018, 8:58pm UTC](https://discuss.elastic.co/t/http-error-401-in-node-401-unauthorized/132532/4 "2018-06-15T20:58:30Z")

</div>

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