嘿~ 今天天气不错嘛

index template问题

Elasticsearch | 作者 keontang | 发布于2016年05月07日 | 阅读数:4927

elasticsearch版本:1.5.2
我写了一个index template模版,然后放在了ES_HOME/conf/templates目录下,好像该模版没有起作用。
我的模版如下:
{
"template_k8s_logstash": {
"template" : "logstash-*",
"mappings" : {
"_default_" : {
"properties" : {
"dynamic" : "true",
}
},
"fluentd" : {
"_source" : {"compress" : false},
"properties" : {
"@timestamp" : {
"type" : "date",
"format" : "dateOptionalTime",
"index" : "not_analyzed"
},
"docker" : {
"properties" : {
"container_id" : {
"type" : "string",
"index" : "not_analyzed"
}
}
},
"kubernetes" : {
"properties" : {
"container_name" : {
"type" : "string",
"index" : "not_analyzed"
},
"namespace_name" : {
"type" : "string",
"index" : "not_analyzed"
},
"pod_name" : {
"type" : "string",
"index" : "not_analyzed"
}
}
}
}
}
}
}
}

elasticsearch启动加载的时候会自动加载 conf/templates中的模版吗?我如何检测模版是否生效?另外,日志中我也没看到关于日志加载的任何打印。
已邀请:

三斗室 - ELK

赞同来自:

看看es的日志里有没有记录。文件形式的template无法通过_template API获取到,所以不建议使用。还是通过接口来管理吧

要回复问题请先登录注册