设置只保留60填的策略
PUT _ilm/policy/streaming-encoder-lifecycle
{
"policy": {
"phases": {
"delete": {
"min_age": "60d",
"actions": {
"delete": {}
}
}
}
}
}
设置索引模板
PUT _template/streaming_encoder-template
{
"index_patterns": ["streaming_encoder-*"],
"aliases": {
"streaming_encoder": {}
},
"settings": {
"number_of_shards": 3,
"number_of_replicas": 1,
"index.lifecycle.name": "streaming-encoder-lifecycle"
},
"mappings": {
"dynamic_templates": [
{
"str_fields": {
"match_mapping_type": "string",
"mapping": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
],
"properties": {
"nickName": {
"type": "keyword"
},
"encodingVBitrate": {
"type": "keyword"
},
"encodingFrames":{
"type":"keyword"
},
"encodingFps":{
"type":"keyword"
},
"bitrate":{
"type":"keyword"
},
"resolution":{
"type":"keyword"
},
"createTime":{
"type":"long"
},
"peerId":{
"type":"keyword"
},
"deviceName":{
"type":"text"
},
"dateSuffix":{
"type":"keyword"
},
"mediaId":{
"type":"keyword"
},
"platformR":{
"type":"keyword"
},
"encoderException":{
"type":"boolean"
}
}
}
}