# Too many fields lost after use customized index name

**URL:** <https://discuss.elastic.co/t/too-many-fields-lost-after-use-customized-index-name/86063>\
**Category:** Beats\
**Created:** [May 17, 2017, 7:55am UTC](https://discuss.elastic.co/t/too-many-fields-lost-after-use-customized-index-name/86063 "2017-05-17T07:55:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaqweb](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@zaqweb](https://discuss.elastic.co/u/zaqweb)\
**Post date:** [May 17, 2017, 7:55am UTC](https://discuss.elastic.co/t/too-many-fields-lost-after-use-customized-index-name/86063/1 "2017-05-17T07:55:50Z")

</div>

hello

I'm using Metricbeat 5.4.0 and everything kept in default except index name in out\>elasticsearch section  
#-------------------------- Elasticsearch output ------------------------------  
output.elasticsearch:  
# Array of hosts to connect to.  
hosts: ["10.0.96.166:9200"]  
index: "portal-metric-%{+[yyyy.MM](http://yyyy.MM)}"  
# Optional protocol and basic auth credentials.  
protocol: "http"  
username: "elastic"  
password: "changeme"

I add above configuration **index: "portal-metric-%{+[yyyy.MM](http://yyyy.MM)}"** and create index pattern portal-metric-\* in kibana, this pattern has only about 100 fields.

while if I remove **index: "portal-metric-%{+[yyyy.MM](http://yyyy.MM)}"** to use default index name like metricbeat-%{+yyyy.MM.dd} it will has about 757 fields.

I don't know why. and I also tried to set template while use customized index name, it's not work either

---

<div class="post-metadata">

**Author:** ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)\
**Post date:** [May 17, 2017, 9:42am UTC](https://discuss.elastic.co/t/too-many-fields-lost-after-use-customized-index-name/86063/2 "2017-05-17T09:42:42Z")

</div>

You may need to edit your `metricbeat.template.json` and adapt it to your index:

Change `"template": "metricbeat-*"` to `"template": "portal-metrics-*"`

Then it your index should get the template right and get all defined fields

---

<div class="post-metadata">

**Author:** ![zaqweb](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@zaqweb](https://discuss.elastic.co/u/zaqweb)\
**Post date:** [May 17, 2017, 9:58am UTC](https://discuss.elastic.co/t/too-many-fields-lost-after-use-customized-index-name/86063/3 "2017-05-17T09:58:03Z")

</div>

thank you for your reply.

i tried that, it's not take effect. and I think `"template": "portal-metrics-*"` in `metricbeat.template.json` is just  
the template name.

---

<div class="post-metadata">

**Author:** ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)\
**Post date:** [May 17, 2017, 10:15am UTC](https://discuss.elastic.co/t/too-many-fields-lost-after-use-customized-index-name/86063/4 "2017-05-17T10:15:33Z")

</div>

The template field is used to match new indexes: [https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html)

Have you tried to recreate the index after loading the new template?

---

<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:** [June 7, 2017, 7:56am UTC](https://discuss.elastic.co/t/too-many-fields-lost-after-use-customized-index-name/86063/5 "2017-06-07T07:56:00Z")

</div>

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