# Metricbeat service throwing error

**URL:** <https://discuss.elastic.co/t/metricbeat-service-throwing-error/147101>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [September 3, 2018, 3:30pm UTC](https://discuss.elastic.co/t/metricbeat-service-throwing-error/147101 "2018-09-03T15:30:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravikt](https://avatars.discourse-cdn.com/v4/letter/r/dfb087/32.png) [@ravikt](https://discuss.elastic.co/u/ravikt)\
**Post date:** [September 3, 2018, 3:30pm UTC](https://discuss.elastic.co/t/metricbeat-service-throwing-error/147101/1 "2018-09-03T15:30:32Z")

</div>

I am trying to add the below config in the metricbeat configuration file and restarting the service is throwing the attached error.

#------------------------------- Windows Module ------------------------------

- module: windows  
metricsets: ["perfmon"]  
enabled: true  
period: 10s  
perfmon.ignore\_non\_existent\_counters: true  
perfmon.counters:

![metricbeat](https://us1.discourse-cdn.com/elastic/original/3X/6/a/6aee775b83ffacb1213d6a863899a32a3191e163.png)

---

<div class="post-metadata">

**Author:** ![adrisr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adrisr/32/25423_2.png) [@adrisr](https://discuss.elastic.co/u/adrisr)\
**Post date:** [September 3, 2018, 6:09pm UTC](https://discuss.elastic.co/t/metricbeat-service-throwing-error/147101/2 "2018-09-03T18:09:35Z")

</div>

Can you share your full configuration? There's probably a Yaml formatting error somewhere. See [Yaml gotchas.](https://www.elastic.co/guide/en/beats/metricbeat/current/yaml-tips.html)

Please enclose the configuration in triple-backticks like this:  
```  
metricbeat.yml  
```

Or use the "preformatted text" button in the editor bar.

---

<div class="post-metadata">

**Author:** ![ravikt](https://avatars.discourse-cdn.com/v4/letter/r/dfb087/32.png) [@ravikt](https://discuss.elastic.co/u/ravikt)\
**Post date:** [September 3, 2018, 6:25pm UTC](https://discuss.elastic.co/t/metricbeat-service-throwing-error/147101/3 "2018-09-03T18:25:29Z")

</div>

###################### Metricbeat Configuration Example #######################

# This file is an example configuration file highlighting only the most common

# options. The metricbeat.reference.yml file from the same directory contains all the

# supported options with more comments. You can use it as a reference.

# 

# You can find the full configuration reference here:

# [https://www.elastic.co/guide/en/beats/metricbeat/index.html](https://www.elastic.co/guide/en/beats/metricbeat/index.html)

#========================== Modules configuration ============================

metricbeat.config.modules:

# Glob pattern for configuration reloading

path: ${path.config}/conf.d/\*.yml

# Period on which files under path should be checked for changes

reload.period: 10s

# Set to true to enable config reloading

reload.enabled: false

# Maximum amount of time to randomly delay the start of a metricset. Use 0 to

# disable startup delay.

metricbeat.max\_start\_delay: 10s

#========================== Modules configuration ============================

metricbeat.modules:

#------------------------------- System Module -------------------------------

- module: system  
metricsets: ["cpu","memory","diskio"]  
enabled: true  
period: 15s  
processes: ['.\*']

#- module: windows

# metricsets: [perfmon]

#enabled: true  
#period: 15s  
#==================== Elasticsearch template setting ==========================

setup.template.settings:  
index.number\_of\_shards: 1  
index.codec: best\_compression  
#\_source.enabled: false

#================================ General =====================================

# The name of the shipper that publishes the network data. It can be used to group

# all the transactions sent by a single shipper in the web interface.

name: metricbeat

# The tags of the shipper are included in their own field with each

# transaction published.

#tags: ["service-X", "web-tier"]

# Optional fields that you can specify to add additional information to the

# output.

#fields:

# env: staging

#============================== Dashboards =====================================

# These settings control loading the sample dashboards to the Kibana index. Loading

# the dashboards is disabled by default and can be enabled either by setting the

# options here, or by using the `-setup` CLI flag or the `setup` command.

#setup.dashboards.enabled: false

# The URL from where to download the dashboards archive. By default this URL

# has a value which is computed based on the Beat name and version. For released

# versions, this URL points to the dashboard archive on the [artifacts.elastic.co](http://artifacts.elastic.co)

# website.

#setup.dashboards.url:

#============================== Kibana =====================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.

# This requires a Kibana endpoint configuration.

# setup.kibana:

# Kibana Host

# Scheme and port can be left out and will be set to the default (http and 5601)

# In case you specify and additional path, the scheme is required: [http://localhost:5601/path](http://localhost:5601/path)

# IPv6 addresses should always be defined as: https://[2001:db8::1]:5601

#host: "localhost:5601"

#============================= Elastic Cloud ==================================

# These settings simplify using metricbeat with the Elastic Cloud ([https://cloud.elastic.co/](https://cloud.elastic.co/)).

# The cloud.id setting overwrites the `output.elasticsearch.hosts` and

# `setup.kibana.host` options.

# You can find the `cloud.id` in the Elastic Cloud web UI.

#cloud.id:

# The cloud.auth setting overwrites the `output.elasticsearch.username` and

# `output.elasticsearch.password` settings. The format is `<user>:<pass>`.

#cloud.auth:

#================================ Outputs =====================================

# Configure what output to use when sending the data collected by the beat.

#-------------------------- Elasticsearch output ------------------------------  
#output.elasticsearch:

# Array of hosts to connect to.

# hosts: ["localhost:9200"]

# hosts: ["[https://search-bps-aws-dev-logsearch-qynup6a6ztj63ffg7ee65aoxve.us-east-1.es.amazonaws.com](https://search-bps-aws-dev-logsearch-qynup6a6ztj63ffg7ee65aoxve.us-east-1.es.amazonaws.com)"]

# Optional protocol and basic auth credentials.

#protocol: "https"  
#username: "elastic"  
#password: "changeme"

#----------------------------- Logstash output --------------------------------  
output.logstash:

# The Logstash hosts

hosts: ["172.31.1.12:5044"]

# Optional SSL. By default is off.

# List of root certificates for HTTPS server verifications

#ssl.certificate\_authorities: ["/etc/pki/root/ca.pem"]

# Certificate for SSL client authentication

#ssl.certificate: "/etc/pki/client/cert.pem"

# Client Certificate Key

#ssl.key: "/etc/pki/client/cert.key"

#================================ Logging =====================================

# Sets log level. The default log level is info.

# Available log levels are: error, warning, info, debug

#logging.level: debug

# At debug level, you can selectively enable logging only for some components.

# To enable all selectors use ["\*"]. Examples of other selectors are "beat",

# "publish", "service".

#logging.selectors: ["\*"]

#============================== Xpack Monitoring ===============================

# metricbeat can export internal metrics to a central Elasticsearch monitoring

# cluster. This requires xpack monitoring to be enabled in Elasticsearch. The

# reporting is disabled by default.

# Set to true to enable the monitoring reporter.

#xpack.monitoring.enabled: false

# Uncomment to send the metrics to Elasticsearch. Most settings from the

# Elasticsearch output are accepted here as well. Any setting that is not set is

# automatically inherited from the Elasticsearch output configuration, so if you

# have the Elasticsearch output configured, you can simply uncomment the

# following line.

#xpack.monitoring.elasticsearch:

---

<div class="post-metadata">

**Author:** ![adrisr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adrisr/32/25423_2.png) [@adrisr](https://discuss.elastic.co/u/adrisr)\
**Post date:** [September 3, 2018, 7:01pm UTC](https://discuss.elastic.co/t/metricbeat-service-throwing-error/147101/4 "2018-09-03T19:01:05Z")

</div>

Can you edit your comment and apply this:

> [@adrisr](#):
>
> Please enclose the configuration in triple-backticks like this:  
> ```  
> metricbeat.yml  
> ```
> 
> Or use the "preformatted text" button in the editor bar.

Otherwise it's impossible to tell if your configuration is badly formatted.

---

<div class="post-metadata">

**Author:** ![ravikt](https://avatars.discourse-cdn.com/v4/letter/r/dfb087/32.png) [@ravikt](https://discuss.elastic.co/u/ravikt)\
**Post date:** [September 3, 2018, 7:24pm UTC](https://discuss.elastic.co/t/metricbeat-service-throwing-error/147101/5 "2018-09-03T19:24:28Z")

</div>

```auto
###################### Metricbeat Configuration Example #######################

# This file is an example configuration file highlighting only the most common
# options. The metricbeat.reference.yml file from the same directory contains all the
# supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/metricbeat/index.html

#========================== Modules configuration ============================

metricbeat.config.modules:
  # Glob pattern for configuration reloading
  path: ${path.config}/conf.d/*.yml

  # Period on which files under path should be checked for changes
  reload.period: 10s

  # Set to true to enable config reloading
  reload.enabled: false

# Maximum amount of time to randomly delay the start of a metricset. Use 0 to
# disable startup delay.
metricbeat.max_start_delay: 10s

#========================== Modules configuration ============================

metricbeat.modules:

#------------------------------- System Module -------------------------------
- module: system
  metricsets: ["cpu","memory","diskio"] 
  enabled: true
  period: 15s
  processes: ['.*']

#- module: windows
 # metricsets: [perfmon]
  #enabled: true
  #period: 15s
#==================== Elasticsearch template setting ==========================

setup.template.settings:
  index.number_of_shards: 1
  index.codec: best_compression
  #_source.enabled: false

#================================ General =====================================

# The name of the shipper that publishes the network data. It can be used to group
# all the transactions sent by a single shipper in the web interface.
name: metricbeat

# The tags of the shipper are included in their own field with each
# transaction published.
#tags: ["service-X", "web-tier"]

# Optional fields that you can specify to add additional information to the
# output.
#fields:
# env: staging

#============================== Dashboards =====================================
# These settings control loading the sample dashboards to the Kibana index. Loading
# the dashboards is disabled by default and can be enabled either by setting the
# options here, or by using the `-setup` CLI flag or the `setup` command.
#setup.dashboards.enabled: false

# The URL from where to download the dashboards archive. By default this URL
# has a value which is computed based on the Beat name and version. For released
# versions, this URL points to the dashboard archive on the artifacts.elastic.co
# website.
#setup.dashboards.url:

#============================== Kibana =====================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
# setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  #host: "localhost:5601"

#============================= Elastic Cloud ==================================

# These settings simplify using metricbeat with the Elastic Cloud (https://cloud.elastic.co/).

# The cloud.id setting overwrites the `output.elasticsearch.hosts` and
# `setup.kibana.host` options.
# You can find the `cloud.id` in the Elastic Cloud web UI.
#cloud.id:

# The cloud.auth setting overwrites the `output.elasticsearch.username` and
# `output.elasticsearch.password` settings. The format is `<user>:<pass>`.
#cloud.auth:

#================================ Outputs =====================================

# Configure what output to use when sending the data collected by the beat.

#-------------------------- Elasticsearch output ------------------------------
#output.elasticsearch:
  # Array of hosts to connect to.
  # hosts: ["localhost:9200"]
  # Optional protocol and basic auth credentials.
  #protocol: "https"
  #username: "elastic"
  #password: "changeme"

#----------------------------- Logstash output --------------------------------
output.logstash:
  # The Logstash hosts
  hosts: ["172.31.1.12:5044"]
  # Optional SSL. By default is off.
  # List of root certificates for HTTPS server verifications
  #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

  # Certificate for SSL client authentication
  #ssl.certificate: "/etc/pki/client/cert.pem"

  # Client Certificate Key
  #ssl.key: "/etc/pki/client/cert.key"

#================================ Logging =====================================

# Sets log level. The default log level is info.
# Available log levels are: error, warning, info, debug
#logging.level: debug

# At debug level, you can selectively enable logging only for some components.
# To enable all selectors use ["*"]. Examples of other selectors are "beat",
# "publish", "service".
#logging.selectors: ["*"]

#============================== Xpack Monitoring ===============================
# metricbeat can export internal metrics to a central Elasticsearch monitoring
# cluster. This requires xpack monitoring to be enabled in Elasticsearch. The
# reporting is disabled by default.

# Set to true to enable the monitoring reporter.
#xpack.monitoring.enabled: false

# Uncomment to send the metrics to Elasticsearch. Most settings from the
# Elasticsearch output are accepted here as well. Any setting that is not set is
# automatically inherited from the Elasticsearch output configuration, so if you
# have the Elasticsearch output configured, you can simply uncomment the
# following line.
#xpack.monitoring.elasticsearch:

```

---

<div class="post-metadata">

**Author:** ![ravikt](https://avatars.discourse-cdn.com/v4/letter/r/dfb087/32.png) [@ravikt](https://discuss.elastic.co/u/ravikt)\
**Post date:** [September 4, 2018, 5:32pm UTC](https://discuss.elastic.co/t/metricbeat-service-throwing-error/147101/6 "2018-09-04T17:32:24Z")

</div>

Did you got chance to look into this?

---

<div class="post-metadata">

**Author:** ![adrisr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adrisr/32/25423_2.png) [@adrisr](https://discuss.elastic.co/u/adrisr)\
**Post date:** [September 4, 2018, 6:10pm UTC](https://discuss.elastic.co/t/metricbeat-service-throwing-error/147101/7 "2018-09-04T18:10:26Z")

</div>

The config you pasted is good to me.

Please run:

```
metricbeat test config

```

And paste the output here.

Also, attach your metricbeat.log (if it doesn't contain any sensitive information). It can be found by default under `C:\programdata\metricbeat\logs\`

---

<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 2, 2018, 6:10pm UTC](https://discuss.elastic.co/t/metricbeat-service-throwing-error/147101/8 "2018-10-02T18:10:28Z")

</div>

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