# Problem with Template File Not Applying Correctly in Logstash

**URL:** https://discuss.elastic.co/t/problem-with-template-file-not-applying-correctly-in-logstash/346006
**Category:** Logstash
**Created:** [October 30, 2023, 7:09am UTC](https://discuss.elastic.co/t/problem-with-template-file-not-applying-correctly-in-logstash/346006 "2023-10-30T07:09:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![inkweon7269](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inkweon7269/32/124738_2.png) [@inkweon7269](https://discuss.elastic.co/u/inkweon7269)
#### Post date: [October 30, 2023, 7:09am UTC](https://discuss.elastic.co/t/problem-with-template-file-not-applying-correctly-in-logstash/346006/1 "2023-10-30T07:09:06Z")

</div>

We are experiencing an issue with Logstash where the user\_dictionary\_rules, stopwords, and synonyms data are not being properly indexed based on the template file in an EC2 environment.

When these data sets, specifically user\_dictionary\_rules, stopwords, and synonyms, are small in size, they are being applied correctly. However, when the quantities increase as listed below, we are encountering indexing issues on our EC2 environment:

- user\_dictionary\_rules: 2,750
- topwords: 380
- synonyms: 71

Our AWS EC2 instance specifications are as follows:

- Instance Type: t2.xlarge
- 4 vCPUs
- 16 GiB Memory

What can be done to resolve this problem?

```auto
{
  "index_patterns": ["product", "product-*"],
  "template": {
    "settings": {
      "index": {
        "analysis": {
          "tokenizer": {
            "nori_analyzer": {
              "type": "nori_tokenizer",
              "decompound_mode": "mixed",
              "discard_punctuation": false,
              "user_dictionary_rules": [....]
            }
          },
          "filter": {
            "nori_filter": {
              "type": "nori_part_of_speech",
              "stoptags": [
                "E", "IC", "J", "MAG", "MAJ", "MM", "SP", "SSC", "SSO", "SC", "SE", "XPN", "XSA", "XSN", "XSV", "UNA", "NA", "VSV"
              ]
            },
            "stop_filter": {
              "type": "stop",
              "stopwords": [...]
            },
            "synonym_filter": {
              "type": "synonym",
              "lenient": true,
              "synonyms": [...]
            }
          },
          "analyzer": {
            "korean": {
              "type": "custom",
              "tokenizer": "nori_analyzer",
              "filter": ["lowercase", "stop", "nori_filter", "stop_filter", "synonym_filter"],
              "char_filter": ["html_strip"]
            }
          }
        }
      }
    },
    "mappings": {
      "_source": {
        "enabled": true
      },
      "properties": {
        "fullName": {
          "type": "text",
          "analyzer": "korean"
        },
        "product": {
          "type": "text",
          "analyzer": "korean"
        },
        "option": {
          "type": "text",
          "analyzer": "korean"
        },
        "salePrice": {
          "type": "integer"
        },
        "offerPrice": {
          "type": "integer"
        },
        "supplier": {
          "type": "keyword"
        },
        "category1": {
          "type": "keyword"
        },
        "category2": {
          "type": "keyword"
        },
        "category3": {
          "type": "keyword"
        },
        "category4": {
          "type": "keyword"
        },
        "brand": {
          "type": "keyword"
        }
      }
    }
  }
}

```

---

<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: [November 27, 2023, 7:09am UTC](https://discuss.elastic.co/t/problem-with-template-file-not-applying-correctly-in-logstash/346006/2 "2023-11-27T07:09:22Z")

</div>

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