Metricbeat failing to import templates on Windows

I'm new to the ELK stack and have killed a couple of hours trawling the forums trying to resolve an issue I am having.

I have followed this guide: https://www.elastic.co/guide/en/elastic-stack-overview/current/get-started-elastic-stack.html

Elastic search is up and running at http://localhost:9200
Kibana is up and running at http://localhost:5601

However, I cannot get Metricbeats to work. I have downloaded it and run through the article above, but when I run the command

`.\metricbeat.exe setup -e`

I get the following error:

http://127.0.0.1:9200/_template/metricbeat-6.4.0: net/http: request canceled (Client.Timeout exceeded while awaiting headers). Response body: . Template is: map[index_patterns:[metricbeat-6.4.0-*] mappings:{"doc":{"_met
a":{"version":"6.4.0"},"date_detection":false,"dynamic_templates":[{"traefik.health.response.status_code":{"mapping":{"type":"long"},"match_mapping_type":"long","path_match":"traefik.health.response.status_code.*"}},{
"system.process.env":{"mapping":{"type":"keyword"},"match_mapping_type":"string","path_match":"system.process.env.*"}},{"system.process.cgroup.cpuacct.percpu":{"mapping":{"type":"long"},"match_mapping_type":"long","pa

If I run the command

.\metricbeat.exe setup --dashboards

I get this error:

Loading dashboards (Kibana must be running and reachable)
Exiting: Error importing Kibana dashboards: fail to import the dashboards in Kibana: Error importing directory C:\Program Files\Metricbeat\kibana: Failed to import index-pattern: Failed to load directory C:\Program Files\Metricbeat\kibana/6/index-pattern:

I have tried so many combinations, and I am finally stumped. Some notes:

  • Elastic search AND Kibana are running from an administrator console
  • Metricbeat commands are being run from an administrator powershell console
  • I am using the latest version of Elastic, Kibana and Metricbeat
  • I have not added modules - I have used the default file metricbeats.yml with some minor changes - could this be the problem? The article doesn't say you need any modules explicitly added and I did try and add the windows module, but it didn't seem to help. In the modules.d folder, the files system.yml and windows.yml do exist
  • Server is Windows Server 2016
  • The file "C:\Program Files\Metricbeat\kibana\6\index-pattern\metricbeat.json" does exist

Metric beats config file as follows:

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

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

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

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

#==================== Elasticsearch template setting ==========================

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

#============================== 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: true

setup.dashboards.directory: ${path.home}/kibana

# 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: "http://localhost:5601"

#================================ 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"]

Any help would be much appreciated!

I'm not quite sure what I did, but I stopped all services, rebooted the box, and everything started working. Go figure.

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