PUT mapping API

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

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