add logs mapping

This commit is contained in:
Cheng Kai 2022-12-02 17:31:08 +08:00
parent 21e9ac552a
commit dca1a2a54b
1 changed files with 55 additions and 0 deletions

View File

@ -186,7 +186,62 @@ PUT $[[INDEX_PREFIX]]metrics-00001
}
}
PUT _template/$[[INDEX_PREFIX]]logs-rollover
{
"order": 100000,
"index_patterns": [
"$[[INDEX_PREFIX]]logs*"
],
"settings": {
"index": {
"format": "7",
"lifecycle": {
"name" : "ilm_$[[INDEX_PREFIX]]metrics-30days-retention",
"rollover_alias" : "$[[INDEX_PREFIX]]logs"
},
"codec": "best_compression",
"number_of_shards": "1",
"translog": {
"durability": "async"
}
}
},
"mappings": {
"dynamic_templates": [
{
"strings": {
"mapping": {
"ignore_above": 256,
"type": "keyword"
},
"match_mapping_type": "string"
}
}
],
"properties": {
"payload.message": {
"type": "text"
},
"timestamp": {
"type": "date"
}
}
},
"aliases": {}
}
PUT $[[INDEX_PREFIX]]logs-00001
{
"settings": {
"index.lifecycle.rollover_alias":"$[[INDEX_PREFIX]]logs"
, "refresh_interval": "5s"
},
"aliases":{
"$[[INDEX_PREFIX]]logs":{
"is_write_index":true
}
}
}
PUT _template/$[[INDEX_PREFIX]]alert-history-rollover
{