curl - XPUT 'localhost:9200/_template/tmp.json' - d '{
"template": "my_index*",
"order": 1,
"settings": {
"index": {
"number_of_replicas": "1",
"number_of_shards": "5"
},
"analysis": {
"analyzer": {
"comma": {
"type": "pattern",
"pattern": ","
}
}
}
},
"mappings": {
"_default_": {
"_all": {
"enabled": false
},
"date_detection": false,
"dynamic_templates": [
{
"tmpl_time_fields": {
"match": "c_time",
"mapping": {
"type": "date",
"format": "epoch_millis||strict_date_optional_time"
}
}
},
{
"tmpl_mod_id": {
"match": "mod_id",
"match_mapping_type": "string",
"mapping": {
"properties": {
"mod_id": {
"type": "text",
"index": "comma"
}
}
}
}
},
{
"tmpl_msg": {
"match": "msg",
"match_mapping_type": "string",
"mapping": {
"properties": {
"msg": {
"type": "text",
"index": "standard"
}
}
}
}
},
{
"tmpl_string_fields": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "keyword",
"doc_values": true
}
}
}
]
}
}
}
'