Hi Team,
Below is my index mapping & i need to map 'has_impact' property from 'key_mapping' to the property in 'template_mapping' during run_time.
How do i achieve that? Appreciate your help.
{
"index-name": {
"mappings": {
"key_mapping": {
"dynamic_templates": [
{
"strings": {
"match_mapping_type": "string",
"mapping": {
"index": true,
"type": "keyword"
}
}
}
],
"properties": {
"@timestamp": {
"type": "date"
},
"@version": {
"type": "keyword"
},
"has_impact": {
"type": "long"
},
"values": {
"properties": {
"alertKey": {
"type": "keyword"
}
}
}
}
},
"template_mapping": {
"dynamic_templates": [
{
"strings": {
"match_mapping_type": "string",
"mapping": {
"index": true,
"type": "keyword"
}
}
}
],
"properties": {
"@timestamp": {
"type": "date"
},
"@version": {
"type": "keyword"
},
"has_impact": {
"type": "long"
},
"values": {
"properties": {
"alertKey": {
"type": "keyword"
}
}
}
}
},
"_default_": {
"dynamic_templates": [
{
"strings": {
"match_mapping_type": "string",
"mapping": {
"index": true,
"type": "keyword"
}
}
}
],
"properties": {
"timestamp": {
"type": "date",
"format": "epoch_millis||date_time"
},
"values": {
"properties": {
"code": {
"type": "integer"
}
}
}
}
}
}
}
}