# Logstash Template Format For Adding Multiple Fields of the Same Type

**URL:** <https://discuss.elastic.co/t/logstash-template-format-for-adding-multiple-fields-of-the-same-type/207263>\
**Category:** Logstash\
**Created:** [November 11, 2019, 2:28am UTC](https://discuss.elastic.co/t/logstash-template-format-for-adding-multiple-fields-of-the-same-type/207263 "2019-11-11T02:28:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott\_stash](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@scott\_stash](https://discuss.elastic.co/u/scott_stash)\
**Post date:** [November 11, 2019, 2:28am UTC](https://discuss.elastic.co/t/logstash-template-format-for-adding-multiple-fields-of-the-same-type/207263/1 "2019-11-11T02:28:39Z")

</div>

My template file is becoming very large as I have had to add a lot of fields to it of Long and Text, so I have the following in the file over and over again: (for text and long types)

```
        "server": {
            "type": "text",
            "norms": false,
            "fields": {
                "keyword": {
                    "type": "keyword",
                    "ignore_above": 10000
                }
            }
        },

```

Is there a way to just define my text definition once.. For instance I see something like this in some examples:

```
"string_fields": {

```

\*\* "match": "\*",  
\*\* "match\_mapping\_type": "string",  
\*\* "mapping": {  
\*\* "type": "text",  
\*\* "norms": false,  
\*\* "fields": {  
\*\* "keyword": {  
\*\* "type": "keyword",  
\*\* "ignore\_above": 10000  
\*\* }  
\*\* }  
\*\* }  
\*\* }

Something like match\_fields, and list all the fields here.

---

<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:** [December 9, 2019, 2:37am UTC](https://discuss.elastic.co/t/logstash-template-format-for-adding-multiple-fields-of-the-same-type/207263/2 "2019-12-09T02:37:11Z")

</div>

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