# Use standard analyzer for specific field in template

**URL:** <https://discuss.elastic.co/t/use-standard-analyzer-for-specific-field-in-template/135105>\
**Category:** Elasticsearch\
**Created:** [June 8, 2018, 7:55am UTC](https://discuss.elastic.co/t/use-standard-analyzer-for-specific-field-in-template/135105 "2018-06-08T07:55:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hvarun](https://avatars.discourse-cdn.com/v4/letter/h/b77776/32.png) [@hvarun](https://discuss.elastic.co/u/hvarun)\
**Post date:** [June 8, 2018, 7:55am UTC](https://discuss.elastic.co/t/use-standard-analyzer-for-specific-field-in-template/135105/1 "2018-06-08T07:55:36Z")

</div>

Hi,

i am trying to create a custom analyzer for a field messagep in the template to get tokens out of the message. below is my template. i am not able to tokenize the input field. anything extra needs to be done?

* * *

{  
"template" : "logstash-_",  
"version" : 50001,  
"settings" : {  
"index.refresh\_interval" : "5s"  
},  
"mappings" : {  
"default" : {  
"\_all" : {"enabled" : true, "norms" : false},  
"dynamic\_templates" : [ {  
"message\_field" : {  
"path\_match" : "message",  
"match\_mapping\_type" : "string",  
"mapping" : {  
"type" : "text",  
"norms" : false  
}  
}  
}, {  
"string\_fields" : {  
"match" : "_",  
"match\_mapping\_type" : "string",  
"mapping" : {  
"type" : "text", "norms" : false,  
"fields" : {  
"keyword" : { "type": "keyword" }  
}  
}  
}  
},{  
"string\_fields" : {  
"match" : "messagep",  
"match\_mapping\_type" : "\*",  
"mapping" : {  
"type" : "string",  
"fields" : {  
"messagep": {  
"type" : "string",  
"analyzer":"standard",  
"tokenizer":"standard"  
},  
"raw": {  
"type" : "string",  
"analyzer":"standard",  
"tokenizer":"standard"  
}  
}

```
      }
    }
  }],
  "properties" : {
    "@timestamp": { "type": "date", "include_in_all": false },
    "@version": { "type": "keyword", "include_in_all": false },
    "geoip" : {
      "dynamic": true,
      "properties" : {
        "ip": { "type": "ip" },
        "location" : { "type" : "geo_point" },
        "latitude" : { "type" : "half_float" },
        "longitude" : { "type" : "half_float" }
      }
    }
  }
}

```

}  
}

---

<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 6, 2018, 7:55am UTC](https://discuss.elastic.co/t/use-standard-analyzer-for-specific-field-in-template/135105/2 "2018-07-06T07:55:48Z")

</div>

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