# How to add not analyzed field with dynamic tempate?

**URL:** <https://discuss.elastic.co/t/how-to-add-not-analyzed-field-with-dynamic-tempate/31391>\
**Category:** Elasticsearch\
**Created:** [September 30, 2015, 9:27am UTC](https://discuss.elastic.co/t/how-to-add-not-analyzed-field-with-dynamic-tempate/31391 "2015-09-30T09:27:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![colormegood](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@colormegood](https://discuss.elastic.co/u/colormegood)\
**Post date:** [September 30, 2015, 9:27am UTC](https://discuss.elastic.co/t/how-to-add-not-analyzed-field-with-dynamic-tempate/31391/1 "2015-09-30T09:27:47Z")

</div>

Hi.

Elasticsearch ; 1.7.1  
logstash : 1.5.3  
kibana : 4

My logstash put my log file on elasticsearch.  
And I discover logstash raw data in kibana 4.

But I hava a problem. kibana 4 seperate field's value by "-"..  
A value of Host name field has a String like "xxx-xxxx".  
Logstash index name has a pattern "logstash-yyyy-mm-dd".

So I found i have to apply not analyzed field with dynamic template.  
Could you tell me how to do it? (I use sense of marvel.)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 30, 2015, 2:52pm UTC](https://discuss.elastic.co/t/how-to-add-not-analyzed-field-with-dynamic-tempate/31391/2 "2015-09-30T14:52:37Z")

</div>

It's not really clear what you want to do here, can you try explaining it again?

---

<div class="post-metadata">

**Author:** ![no\_jihun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/no_jihun/32/64028_2.png) [@no\_jihun](https://discuss.elastic.co/u/no_jihun)\
**Post date:** [October 1, 2015, 1:03am UTC](https://discuss.elastic.co/t/how-to-add-not-analyzed-field-with-dynamic-tempate/31391/3 "2015-10-01T01:03:55Z")

</div>

here is my setting.

PUT /\_template/default\_template  
{  
"template": "logstash-_",  
"settings": {  
"index.number\_of\_replicas": "1",  
"index.number\_of\_shards": "5"  
},  
"mappings": {  
"default": {  
"dynamic\_templates": [  
{  
"string\_match": {  
"mapping": {  
"index": "not\_analyzed",  
"doc\_values": true,  
"type": "string"  
},  
"match": "_",  
"match\_mapping\_type": "string"  
}  
},  
{  
"other": {  
"mapping": {  
"doc\_values": true  
},  
"match": "_",  
"match\_mapping\_type": "_"  
}  
}  
],  
"\_all": {  
"enabled": false  
}  
}  
},  
"aliases": {}  
}

---

<div class="post-metadata">

**Author:** ![colormegood](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@colormegood](https://discuss.elastic.co/u/colormegood)\
**Post date:** [October 1, 2015, 1:22am UTC](https://discuss.elastic.co/t/how-to-add-not-analyzed-field-with-dynamic-tempate/31391/4 "2015-10-01T01:22:22Z")

</div>

@no_jihun

Thanks a lot for your replay.

---

<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 5, 2017, 11:47pm UTC](https://discuss.elastic.co/t/how-to-add-not-analyzed-field-with-dynamic-tempate/31391/5 "2017-07-05T23:47:18Z")

</div>


