# How to add \_size mapping to index legacy template in elasticsearch?

**URL:** <https://discuss.elastic.co/t/how-to-add-size-mapping-to-index-legacy-template-in-elasticsearch/335672>\
**Category:** Elasticsearch\
**Created:** [June 10, 2023, 5:06am UTC](https://discuss.elastic.co/t/how-to-add-size-mapping-to-index-legacy-template-in-elasticsearch/335672 "2023-06-10T05:06:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amirhossein\_eidy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amirhossein_eidy/32/121807_2.png) [@Amirhossein\_eidy](https://discuss.elastic.co/u/Amirhossein_eidy)\
**Post date:** [June 10, 2023, 5:06am UTC](https://discuss.elastic.co/t/how-to-add-size-mapping-to-index-legacy-template-in-elasticsearch/335672/1 "2023-06-10T05:06:57Z")

</div>

Hi friends

I have installed size mapping plugin and I added it to Kibana meta fields too

I could successfully enable "\_size" in Elasticsearch via bellow command and see the result in kibana

```auto
PUT logstash-2023-06-06
{
  "mappings": {
    "_size": {
      "enabled": true
    }
  }
} 

```

but I could just enable size field in a single upcoming index, how to enable \_size mapping in all of my upcoming indices and legacy index template?  
should I add it in Kibana legacy index template or elasticsearch?

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [June 10, 2023, 5:16am UTC](https://discuss.elastic.co/t/how-to-add-size-mapping-to-index-legacy-template-in-elasticsearch/335672/2 "2023-06-10T05:16:38Z")

</div>

Hi @Amirhossein_eidy

Duplicate Question. This question has already been answered.

> [@How to add \_size mapping to index template in elasticsearch?](https://discuss.elastic.co/t/how-to-add-size-mapping-to-index-template-in-elasticsearch/335432):
>
> Hi friends I have installed size mapping plugin and I added it to Kibana meta fields too I could successfully enable "\_size" in Elasticsearch via bellow command and see the result in kibana PUT logstash-2023-06-06 { "mappings": { "\_size": { "enabled": true } } } but I could just enable size field in a single upcoming index, how to enable \_size mapping in all of my upcoming indices and index template? should I add it in Kibana index template or elasticsearch?

---

<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:** [July 8, 2023, 5:30am UTC](https://discuss.elastic.co/t/how-to-add-size-mapping-to-index-legacy-template-in-elasticsearch/335672/4 "2023-07-08T05:30:02Z")

</div>

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