Hi
I want to setup a default template for some specific fields, that I want added to every other template.
So template 1 has fields x,y,z and template 2 has fields a,b,c
The index should know the "types" (don't know if that is the correct word) for a,b,c,x,y,z
Basically for now I am using the following template
and would like to add the following
standard.action
standard.dst_ip
etc
etc
I am trying to do this via the following, which doesn't let the index create due to "Rejecting mapping update to [wazuh-logs-3.x-2019.01.31] as the final mapping would have more than 1 type"
put _template/standard-fields
{
"index_patterns": ["*"],
"order": -1,
"mappings": {
"standard": {
"properties": {
"src_ip": {
"type": "keyword",
"doc_values": "true"
},
"dst_ip": {
"type": "keyword",
"doc_values": "true"
},
"src_port": {
"type": "keyword",
"doc_values": "true"
},
"dst_port": {
"type": "keyword",
"doc_values": "true"
},
"action": {
"type": "keyword",
"doc_values": "true"
}
}
}
}
}
I have then tried the following
{
"index_patterns": ["*"],
"order": -1,
"mappings": {
"wazuh": {
"dynamic_templates": [
{
"string_as_keyword": {
"match_mapping_type": "string",
"mapping": {
"type": "keyword",
"doc_values": "true"
}
}
}
],
"properties": {
"standard": {
"properties": {
"src_ip": {
"type": "keyword",
"doc_values": "true"
},
"dst_ip": {
"type": "keyword",
"doc_values": "true"
},
"src_port": {
"type": "keyword",
"doc_values": "true"
},
"dst_port": {
"type": "keyword",
"doc_values": "true"
},
"action": {
"type": "keyword",
"doc_values": "true"
}
}
}
}
}
}
}
This allows the index to create, however
- The "new" fields aren't "mapped" to a "type" (again not sure if my terminology is correct), I presume as it is overwritten by the hyperlinked (above) template.
- I presume I will have issues with other index creations (of other names) due to the issue "more than 1 type issue"
So any advice on how I would best "apply" those fields (and relevant type) across all indexes ?
Any help is appreciated
PS I am running 6.5.4
Thanks