# Metricbeat fields defaults

**URL:** https://discuss.elastic.co/t/metricbeat-fields-defaults/100365
**Category:** Beats
**Tags:** metricbeat
**Created:** [September 13, 2017, 1:43pm UTC](https://discuss.elastic.co/t/metricbeat-fields-defaults/100365 "2017-09-13T13:43:09Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![GogLlundain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gogllundain/32/15620_2.png) [@GogLlundain](https://discuss.elastic.co/u/GogLlundain)
#### Post date: [September 13, 2017, 1:43pm UTC](https://discuss.elastic.co/t/metricbeat-fields-defaults/100365/1 "2017-09-13T13:43:09Z")

</div>

Hi,

I'm running a test cluster and a production cluster, metricbeats is one of the things posting data into both of these.

In the metricbeat-\* index pattern on my dev cluster the `host` field is searchable and aggregatable but on my production cluster I have a `host` field (searchable and analyzed) and a `host.keyword` (searchable and aggregatable) alongside it. I don't know how that got there, I haven't been messing with the mapping API or the template files.

Because my dev/prod clusters have different fields it's messing up my [ElastAlert](https://github.com/Yelp/elastalert) YAML, one references host and the other needs host.keyword.

Which setup is correct according to MetricBeat defaults and how do I get them in sync?

Gog

---

<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: [September 13, 2017, 2:57pm UTC](https://discuss.elastic.co/t/metricbeat-fields-defaults/100365/2 "2017-09-13T14:57:38Z")

</div>

It sounds like the prod cluster doesn't have the index template installed. The `host` field should be a [keyword datatype](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/keyword.html). See [Loading the Index Template in Elasticsearch](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-template.html).

---

<div class="post-metadata">

### Author: ![GogLlundain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gogllundain/32/15620_2.png) [@GogLlundain](https://discuss.elastic.co/u/GogLlundain)
#### Post date: [September 13, 2017, 3:07pm UTC](https://discuss.elastic.co/t/metricbeat-fields-defaults/100365/3 "2017-09-13T15:07:58Z")

</div>

I wondered that too, but I don't remember having to do that in the dev cluster.

If I do post the template to the prod cluster presumably all new indexes will adhere to it but it won't apply to the existing data?

---

<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: [September 13, 2017, 4:09pm UTC](https://discuss.elastic.co/t/metricbeat-fields-defaults/100365/4 "2017-09-13T16:09:16Z")

</div>

That's correct. It will not apply retroactively. The data in those indices would need to [reindexed](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html).

---

<div class="post-metadata">

### Author: ![GogLlundain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gogllundain/32/15620_2.png) [@GogLlundain](https://discuss.elastic.co/u/GogLlundain)
#### Post date: [September 14, 2017, 7:53am UTC](https://discuss.elastic.co/t/metricbeat-fields-defaults/100365/5 "2017-09-14T07:53:26Z")

</div>

Reindexing metricbeats data is hard... 😛

I'll `curl` the template in and post back with the results.

---

<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: [September 14, 2017, 2:31pm UTC](https://discuss.elastic.co/t/metricbeat-fields-defaults/100365/6 "2017-09-14T14:31:33Z")

</div>

> [@GogLlundain](#):
>
> Reindexing metricbeats data is hard...

Reindexing is pretty easy with the reindex API.

```auto
POST _reindex
{
  "source": {
    "index": "metricbeat-2017.01.01"
  },
  "dest": {
    "index": "metricbeat-2017.01.01-a"
  }
}

```

Then after that completes you delete the metricbeat-2017.01.01 index.

---

<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 12, 2017, 2:31pm UTC](https://discuss.elastic.co/t/metricbeat-fields-defaults/100365/7 "2017-10-12T14:31:47Z")

</div>

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