# Fielddata is disabled on text fields by default. Set fielddata=true on \[beat.name\]

**URL:** https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true-on-beat-name/60283
**Category:** Beats
**Created:** [September 12, 2016, 11:51am UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true-on-beat-name/60283 "2016-09-12T11:51:32Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![YuWatanabe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuwatanabe/32/13259_2.png) [@YuWatanabe](https://discuss.elastic.co/u/YuWatanabe)
#### Post date: [September 12, 2016, 11:51am UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true-on-beat-name/60283/1 "2016-09-12T11:51:32Z")

</div>

Hi.

I have imported dashboard template using import\_dashboards.sh for metricbeat.  
But below errors appears when I select any of the imported dashhboard.

![](https://us1.discourse-cdn.com/elastic/original/2X/f/fdb6e2b32cbef4535bd448ecf4ece4274a3aef3c.PNG)

**My Environemnt**  
metricbeat-5.0.0 alpha5  
kibana-5.0.0 alpha5

Do I need to fix the index-pattern json file ?

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [September 12, 2016, 2:13pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true-on-beat-name/60283/2 "2016-09-12T14:13:51Z")

</div>

Did you load the metricbeat index template before loading the dashboard? Under 5.0 [beat.name](http://beat.name) should be a keyword: [https://github.com/elastic/beats/blob/master/metricbeat/metricbeat.template.json#L184](https://github.com/elastic/beats/blob/master/metricbeat/metricbeat.template.json#L184)

The index template is loaded automatically the first time you start metricbeat.

---

<div class="post-metadata">

### Author: ![monica](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/monica/32/3696_2.png) [@monica](https://discuss.elastic.co/u/monica)
#### Post date: [September 12, 2016, 4:59pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true-on-beat-name/60283/3 "2016-09-12T16:59:45Z")

</div>

I have tried to load the dashboards before starting metricbeat for the first time, and I don't get this error when opening any dashboard. Could you please give us more details here? What version of Elasticsearch are you using?

Can you please let us know what value is returned by the following command? Is the value different than `{ }`? Is it different than the `metricbeat.template.json` file or `metricbeat.template-es2x.json` if you are using the Elasticsearch 2.x, available in the metricbeat package?

```auto
curl -XGET 'http://localhost:9200/_template/metricbeat?pretty=true'

```

---

<div class="post-metadata">

### Author: ![YuWatanabe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuwatanabe/32/13259_2.png) [@YuWatanabe](https://discuss.elastic.co/u/YuWatanabe)
#### Post date: [September 12, 2016, 9:11pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true-on-beat-name/60283/4 "2016-09-12T21:11:44Z")

</div>

Hello @ruflin @monica.

Thanks for the reply.

Below is my version info of elasticsearch and metricbeat.

```
[root@BS-POC-Test-Env kibana]# rpm -qi elasticsearch
Name : elasticsearch
Epoch : 0
Version : 5.0.0_alpha5
Release : 1
Architecture: noarch
Install Date: Fri 02 Sep 2016 09:14:40 AM UTC
Group : Application/Internet
Size : 35717321
License : 2009
Signature : RSA/SHA1, Thu 04 Aug 2016 09:03:01 AM UTC, Key ID d27d666cd88e42b4
Source RPM : elasticsearch-5.0.0_alpha5-1-src.rpm
Build Date : Thu 04 Aug 2016 09:03:00 AM UTC
Build Host : vagrant-ubuntu-trusty-64
Relocations : /usr
Packager : Elasticsearch
Vendor : Elasticsearch
URL : https://www.elastic.co/
Summary : Elasticsearch is a distributed RESTful search engine built for the cloud. Reference documentation can be found at https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html and the 'Elasticsearch: The Definitive Guide' book can be found at https://www.elastic.co/guide/en/elasticsearch/guide/current/index.html
Description :
Elasticsearch subproject :distribution:rpm

[root@BS-POC-Test-Env kibana]# rpm -qi metricbeat
Name : metricbeat
Version : 5.0.0_alpha5
Release : 1
Architecture: x86_64
Install Date: Sun 11 Sep 2016 09:48:34 PM UTC
Group : default
Size : 19063002
License : ASL 2.0
Signature : (none)
Source RPM : metricbeat-5.0.0_alpha5-1.src.rpm
Build Date : Thu 04 Aug 2016 11:20:06 AM UTC
Build Host : 51b02caac0ef
Relocations : /
Packager : <@51b02caac0ef>
Vendor : Elastic
URL : https://github.com/elastic/beats/metricbeat
Summary : Sends metrics to Elasticsearch.
Description :
Sends metrics to Elasticsearch.

```

I also have the latest xpack installed.

```
[root@BS-POC-Test-Env bin]# ./elasticsearch-plugin list -v
Plugins directory: /usr/share/elasticsearch/plugins
x-pack
- Plugin information:
Name: x-pack
Description: Elasticsearch Expanded Pack Plugin
Version: 5.0.0-alpha5
 * Classname: org.elasticsearch.xpack.XPackPlugin

[root@BS-POC-Test-Env bin]# ./kibana-plugin list
x-pack@5.0.0-alpha5-SNAPSHOT

```

Regarding to \_template API , it shows nothing ....

```
[root@BS-POC-Test-Env kibana]# curl -u elastic:elastic -XGET 'http://localhost:9200/_template/metricbeat?pretty=true'
{ }
```

---

<div class="post-metadata">

### Author: ![YuWatanabe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuwatanabe/32/13259_2.png) [@YuWatanabe](https://discuss.elastic.co/u/YuWatanabe)
#### Post date: [September 12, 2016, 9:19pm UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true-on-beat-name/60283/5 "2016-09-12T21:19:12Z")

</div>

I have forgotten to import the template.

However, since I use logstash as a indexer, I manually imported the template as shown in the [document](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-template.html#load-template-manually).

The curl command returned empty result and I have missed this fact.

```
[root@BS-POC-Test-Env metricbeat]# curl -u elastic:elastic -XPUT 'http://localhost:9200/_template/metricbeat' -d@/etc/metricbeat/metricbeat.template.json
curl: (52) Empty reply from server

```

As pointed in [here](https://github.com/elastic/beats/issues/2208#issuecomment-238791331),  
I have added the -H option in curl command and now I have my dashboard working.

`[root@BS-POC-Test-Env metricbeat]# curl -u elastic:elastic -H 'Expect:' -XPUT 'http://localhost:9200/_template/metricbeat' -d@/etc/metricbeat/metricbeat.template.json`

---

<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 3, 2016, 11:51am UTC](https://discuss.elastic.co/t/fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true-on-beat-name/60283/6 "2016-10-03T11:51:42Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
