# Elasticsearch Dynamic Mapping Question

**URL:** <https://discuss.elastic.co/t/elasticsearch-dynamic-mapping-question/20146>\
**Category:** Elasticsearch\
**Created:** [October 8, 2014, 5:53pm UTC](https://discuss.elastic.co/t/elasticsearch-dynamic-mapping-question/20146 "2014-10-08T17:53:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elorion](https://avatars.discourse-cdn.com/v4/letter/e/97f17d/32.png) [@elorion](https://discuss.elastic.co/u/elorion)\
**Post date:** [October 8, 2014, 5:53pm UTC](https://discuss.elastic.co/t/elasticsearch-dynamic-mapping-question/20146/1 "2014-10-08T17:53:35Z")

</div>

Howdy All,

Just looking to get some advice on how to get the following dynamic mapping  
working correctly. I'm fairly new to the mapping world in ES and would like  
some help if possible. Can you let me know if this syntax is correct? Thanks

{  
"template": "logstash-\*",  
"settings": {  
"index.refresh\_interval": "5s"  
},  
"mappings": {  
"_default_": {  
"\_all": {  
"enabled": true  
},  
"dynamic\_templates": [{  
"address\_fields": {  
"match": "\*address",  
"match\_mapping\_type": "string",  
"mapping": {  
"type": "ip",  
"index": "not\_analyzed",  
"omit\_norms": true,  
}  
}  
},  
{  
"port\_fields": {  
"match": "_port",  
"match\_mapping\_type": "string",  
"mapping": {  
"type": "integer",  
"index": "not\_analyzed",  
"omit\_norms": true,  
}  
}  
},  
{  
"string\_fields": {  
"match": "_",  
"match\_mapping\_type": "string",  
"mapping": {  
"type": "string",  
"index": "not\_analyzed",  
"omit\_norms": true,  
"fields": {  
"raw": {  
"type": "string",  
"index": "not\_analyzed",  
"ignore\_above": 256  
}  
}  
}  
}  
}],  
"properties": {  
"@version": {  
"type": "string",  
"index": "not\_analyzed"  
},  
"geoip": {  
"type": "object",  
"dynamic": true,  
"path": "full",  
"properties": {  
"location": {  
"type": "geo\_point"  
}  
}  
}  
}  
}  
}  
}

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2e5cd80e-7f39-4bc6-9da0-8404a13e3b69%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2e5cd80e-7f39-4bc6-9da0-8404a13e3b69%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![elorion](https://avatars.discourse-cdn.com/v4/letter/e/97f17d/32.png) [@elorion](https://discuss.elastic.co/u/elorion)\
**Post date:** [October 9, 2014, 8:32pm UTC](https://discuss.elastic.co/t/elasticsearch-dynamic-mapping-question/20146/2 "2014-10-09T20:32:05Z")

</div>

Any thoughts?

On Wednesday, October 8, 2014 1:53:35 PM UTC-4, [elo...@gmail.com](mailto:elo...@gmail.com) wrote:

> Howdy All,
> 
> Just looking to get some advice on how to get the following dynamic  
> mapping working correctly. I'm fairly new to the mapping world in ES and  
> would like some help if possible. Can you let me know if this syntax is  
> correct? Thanks
> 
> {  
> "template": "logstash-\*",  
> "settings": {  
> "index.refresh\_interval": "5s"  
> },  
> "mappings": {  
> "_default_": {  
> "\_all": {  
> "enabled": true  
> },  
> "dynamic\_templates": [{  
> "address\_fields": {  
> "match": "\*address",  
> "match\_mapping\_type": "string",  
> "mapping": {  
> "type": "ip",  
> "index": "not\_analyzed",  
> "omit\_norms": true,  
> }  
> }  
> },  
> {  
> "port\_fields": {  
> "match": "_port",  
> "match\_mapping\_type": "string",  
> "mapping": {  
> "type": "integer",  
> "index": "not\_analyzed",  
> "omit\_norms": true,  
> }  
> }  
> },  
> {  
> "string\_fields": {  
> "match": "_",  
> "match\_mapping\_type": "string",  
> "mapping": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "omit\_norms": true,  
> "fields": {  
> "raw": {  
> "type": "string",  
> "index": "not\_analyzed",  
> "ignore\_above": 256  
> }  
> }  
> }  
> }  
> }],  
> "properties": {  
> "@version": {  
> "type": "string",  
> "index": "not\_analyzed"  
> },  
> "geoip": {  
> "type": "object",  
> "dynamic": true,  
> "path": "full",  
> "properties": {  
> "location": {  
> "type": "geo\_point"  
> }  
> }  
> }  
> }  
> }  
> }  
> }

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8ffb0e58-74cd-49ae-a5b7-0abbe669aafd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8ffb0e58-74cd-49ae-a5b7-0abbe669aafd%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 2017, 12:57am UTC](https://discuss.elastic.co/t/elasticsearch-dynamic-mapping-question/20146/3 "2017-07-06T00:57:12Z")

</div>


