# Metricbeat failing to import templates on Windows

**URL:** https://discuss.elastic.co/t/metricbeat-failing-to-import-templates-on-windows/146529
**Category:** Beats
**Tags:** metricbeat
**Created:** [August 29, 2018, 12:13pm UTC](https://discuss.elastic.co/t/metricbeat-failing-to-import-templates-on-windows/146529 "2018-08-29T12:13:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mrsalmon](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@mrsalmon](https://discuss.elastic.co/u/mrsalmon)
#### Post date: [August 29, 2018, 12:13pm UTC](https://discuss.elastic.co/t/metricbeat-failing-to-import-templates-on-windows/146529/1 "2018-08-29T12:13:26Z")

</div>

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](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](http://localhost:9200)  
Kibana is up and running at [http://localhost:5601](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:

```auto
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:

```auto
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:

```auto
    #========================== 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!

---

<div class="post-metadata">

### Author: ![mrsalmon](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@mrsalmon](https://discuss.elastic.co/u/mrsalmon)
#### Post date: [August 29, 2018, 3:12pm UTC](https://discuss.elastic.co/t/metricbeat-failing-to-import-templates-on-windows/146529/2 "2018-08-29T15:12:18Z")

</div>

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

---

<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: [September 26, 2018, 3:12pm UTC](https://discuss.elastic.co/t/metricbeat-failing-to-import-templates-on-windows/146529/3 "2018-09-26T15:12:25Z")

</div>

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