# 401 Unauthorized Error

**URL:** <https://discuss.elastic.co/t/401-unauthorized-error/99460>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [September 5, 2017, 4:18pm UTC](https://discuss.elastic.co/t/401-unauthorized-error/99460 "2017-09-05T16:18:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ratnakar\_Sadasyula](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ratnakar_sadasyula/32/21775_2.png) [@Ratnakar\_Sadasyula](https://discuss.elastic.co/u/Ratnakar_Sadasyula)\
**Post date:** [September 5, 2017, 4:18pm UTC](https://discuss.elastic.co/t/401-unauthorized-error/99460/1 "2017-09-05T16:18:48Z")

</div>

Hi

I installed MetricBeat 5.5.x on Windows along with ElasticSearch 5.5.2,

I started ElasticSearch and MetricBeat, confirmed it is running with localhost:9200

I also started MetricBeat, however in the log file this is the only output I am getting continously

2017-09-05T21:41:36+05:30 ERR Error getting process details. pid=10884: error getting process arguments for pid=10884: ProcArgs failed for pid=10884: could not get Win32\_Process WHERE ProcessId = 10884: wmi: cannot load field "CommandLine" into a "string": unsupported type ()  
2017-09-05T21:41:43+05:30 INFO Non-zero metrics in the last 30s: fetches.apache-status.events=3 fetches.apache-status.failures=3 fetches.system-cpu.events=1 fetches.system-cpu.success=1 fetches.system-filesystem.events=1 fetches.system-filesystem.success=1 fetches.system-fsstat.events=1 fetches.system-fsstat.success=1 fetches.system-memory.events=1 fetches.system-memory.success=1 fetches.system-network.events=1 fetches.system-network.success=1 fetches.system-process.events=39 fetches.system-process.success=1 libbeat.es.publish.read\_bytes=393 libbeat.es.publish.write\_bytes=121 libbeat.outputs.messages\_dropped=1 libbeat.publisher.messages\_in\_worker\_queues=50 libbeat.publisher.published\_events=50  
2017-09-05T21:42:13+05:30 INFO Non-zero metrics in the last 30s: fetches.system-cpu.events=1 fetches.system-cpu.success=1 fetches.system-filesystem.events=1 fetches.system-filesystem.success=1 fetches.system-network.events=1 fetches.system-network.success=1  
2017-09-05T21:42:36+05:30 ERR Connecting error publishing events (retrying): 401 Unauthorized  
2017-09-05T21:42:43+05:30 INFO Non-zero metrics in the last 30s: libbeat.es.publish.read\_bytes=393 libbeat.es.publish.write\_bytes=121  
2017-09-05T21:43:13+05:30 INFO No non-zero metrics in the last 30s  
2017-09-05T21:43:36+05:30 ERR Connecting error publishing events (retrying): 401 Unauthorized  
2017-09-05T21:43:43+05:30 INFO Non-zero metrics in the last 30s: libbeat.es.publish.read\_bytes=393 libbeat.es.publish.write\_bytes=121  
2017-09-05T21:44:13+05:30 INFO No non-zero metrics in the last 30s  
2017-09-05T21:44:36+05:30 ERR Connecting error publishing events (retrying): 401 Unauthorized  
2017-09-05T21:44:43+05:30 INFO Non-zero metrics in the last 30s: libbeat.es.publish.read\_bytes=393 libbeat.es.publish.write\_bytes=121  
2017-09-05T21:45:13+05:30 INFO No non-zero metrics in the last 30s  
2017-09-05T21:45:36+05:30 ERR Connecting error publishing events (retrying): 401 Unauthorized  
2017-09-05T21:45:43+05:30 INFO Non-zero metrics in the last 30s: fetches.apache-status.events=3 fetches.apache-status.failures=3 fetches.system-cpu.events=1 fetches.system-cpu.success=1 fetches.system-filesystem.events=1 fetches.system-filesystem.success=1 fetches.system-fsstat.events=1 fetches.system-fsstat.success=1 fetches.system-memory.events=1 fetches.system-memory.success=1 fetches.system-network.events=1 fetches.system-network.success=1 fetches.system-process.events=39 libbeat.es.publish.read\_bytes=393 libbeat.es.publish.write\_bytes=121 libbeat.outputs.messages\_dropped=1 libbeat.publisher.messages\_in\_worker\_queues=50 libbeat.publisher.published\_events=50  
2017-09-05T21:46:13+05:30 INFO Non-zero metrics in the last 30s: fetches.system-filesystem.events=1 fetches.system-filesystem.success=1 fetches.system-fsstat.events=1 fetches.system-fsstat.success=1 fetches.system-memory.events=1 fetches.system-memory.success=1  
2017-09-05T21:46:36+05:30 ERR Connecting error publishing events (retrying): 401 Unauthorized  
2017-09-05T21:46:43+05:30 INFO Non-zero metrics in the last 30s: libbeat.es.publish.read\_bytes=393 libbeat.es.publish.write\_bytes=121  
2017-09-05T21:47:13+05:30 INFO No non-zero metrics in the last 30s  
2017-09-05T21:47:36+05:30 ERR Connecting error publishing events (retrying): 401 Unauthorized  
2017-09-05T21:47:43+05:30 INFO Non-zero metrics in the last 30s: libbeat.es.publish.read\_bytes=393 libbeat.es.publish.write\_bytes=121

What is the issue here?

This is my metricbeat.yml configuration

#------------------------------- System Module -------------------------------  
metricbeat.modules:

- module: system  
metricsets:
  - cpu
  - filesystem
  - memory
  - network
  - process  
enabled: true  
period: 10s  
processes: ['.\*']  
cpu\_ticks: false

- module: apache  
metricsets: ["status"]  
enabled: true  
period: 1s  
hosts: ["[http://127.0.0.1](http://127.0.0.1)"]

output.elasticsearch:

# Array of hosts to connect to.

hosts: ["localhost:9200"]  
protocol: "https"  
username: "elastic"  
password: "changeme"  
template.enabled: true  
template.path: "metricbeat.template.json"  
template.overwrite: false

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [September 6, 2017, 11:12am UTC](https://discuss.elastic.co/t/401-unauthorized-error/99460/2 "2017-09-06T11:12:36Z")

</div>

Please properly format logs and configuration files using the `</>` button in the editors toolbar. The config files are sensitive to whitespace + some characters in logs and configs do trigger some formatting in this forum.

`401 Unauthorized` is returned by Elasticsearch. Maybe your username or password is wrong? Have you verified them using curl?

---

<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:** [October 4, 2017, 11:12am UTC](https://discuss.elastic.co/t/401-unauthorized-error/99460/3 "2017-10-04T11:12:59Z")

</div>

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