# PUT mapping API

**URL:** <https://discuss.elastic.co/t/put-mapping-api/151698>\
**Category:** Elasticsearch\
**Created:** [October 9, 2018, 6:51pm UTC](https://discuss.elastic.co/t/put-mapping-api/151698 "2018-10-09T18:51:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Timshs](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@Timshs](https://discuss.elastic.co/u/Timshs)\
**Post date:** [October 9, 2018, 6:51pm UTC](https://discuss.elastic.co/t/put-mapping-api/151698/1 "2018-10-09T18:51:50Z")

</div>

I want to add a dynamic field in my mappings on my METRICS property. I am wondering if I can do it like this?:

PUT tm\_ag\_index/\_mapping/logs  
{  
"dynamic": "false",  
"properties": {  
"Level": {  
"type": "text"  
},  
"Timestamp": {  
"type": "date"  
},  
"properties": {  
"Properties": {  
"InfoId": {  
"type": "keyword"  
}  
}  
},  
"properties": {  
"dynamic": "true",  
"Properties": {  
"METRICS=\*": {  
"type": "keyword"  
}  
}  
}  
}  
}

my json output is as following:

"\_source": {  
"MessageTemplate": "xxx",  
"@version": "1",  
"Level": "Information",  
"@timestamp": "2018-10-09T18:35:26.448Z",  
"Properties": {  
"METRICS=firstSignalReceived": 1,  
"WindowsService": true,  
"MachineName": "VM1",  
"EntryAssembly": "AG.API",  
"ThreadId": 57  
},  
"Timestamp": "2018-10-09T18:35:24.8096940+00:00"  
},

The METRICS property can be different like firstSignalReceived, secondSignalReceived etc so I want all with METRICS to be created .... The infoid and level field names must not be dynamic

---

<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 6, 2018, 6:53pm UTC](https://discuss.elastic.co/t/put-mapping-api/151698/2 "2018-11-06T18:53:41Z")

</div>

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