我正在尝试如下创建模板:
PUT _template/test
{
"index_patterns": ["test_\\d{4}\\d{2}\\d{2}"],
"settings":{
"number_of_shards": 1
},
"aliases": {
"test_daily": {}
}
}
但是ES似乎不支持此操作。
响应为:
{
"error": {
"root_cause": [
{
"type": "invalid_index_template_exception",
"reason": "index_template [test] invalid, cause [Validation Failed: 1: template must not contain the following characters [ , \", *, \\, <, |, ,, >, /, ?];]"
}
],
"type": "invalid_index_template_exception",
"reason": "index_template [test] invalid, cause [Validation Failed: 1: template must not contain the following characters [ , \", *, \\, <, |, ,, >, /, ?];]"
},
"status": 400
}
我知道我可以使用"index_patterns":["test_*"]
但是我想知道是否可以在模板index_patterns字段上添加更具体的正则表达式,例如可以在dynamic_template
上进行映射。