나는 시스템 로그를 수집하는 logstash + elasticsearch를 사용하고은 내가, elasticsearch-template.json
내가 logstash에서 elasticsearch-template.json라는 이름의 파일을 찾을 노화 로그의 TTL을 설정할 통해 기본 elasticsearch 매핑을 logstash 설정할 수 있습니다
{
"template" : "logstash-*",
"settings" : {
"index.refresh_interval" : "5s"
},
"mappings" : {
"_default_" : {
"_all" : {"enabled" : true},
"dynamic_templates" : [ {
"string_fields" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string", "index" : "analyzed", "omit_norms" : true,
"fields" : {
"raw" : {"type": "string", "index" : "not_analyzed", "ignore_above" : 256}
}
}
}
} ],
"_ttl": {
"enabled": true,
"default": "1d"
},
"properties" : {
"@version": { "type": "string", "index": "not_analyzed" },
"geoip" : {
"type" : "object",
"dynamic": true,
"path": "full",
"properties" : {
"location" : { "type" : "geo_point" }
}
}
}
}
}
}
다음 logstash를 다시 시작, 삭제 : 경로가 logstash/logstash-1.4.2/logstash/출력 elasticsearch/elasticsearch-template.json
이 같은 파일에 TTL 정보를 추가 lib 디렉토리//입니다 모든 elasticsearch 지수. elasticsearch에서 새 색인의 매핑을 확인했지만이 방법으로 작동하지 않았습니다.
인덱스 템플릿은 어떻게 구성합니까?
있다, 기능이 많은 "KOPF"라는 이름의 플러그인이있다. 그 중 하나는 템플릿을 쉽게 편집하고 편집기에 저장하는 것입니다. 클러스터 등을 기반으로 한 파편/복제본 수 변경과 같은 일이 있습니다. – Maziyar