GET _ilm/policy/demo_1
PUT _ilm/policy/demo_1
{
"policy": {
"phases": {
"hot": {
"min_age": "0",
"actions": {
"set_priority": {
"priority": 100
},
"rollover": {
"max_age": "3d",
"max_docs": 3,
"max_size": "2gb"
}
}
},
"warm": {
"min_age": "1d",
"actions": {
"set_priority": {
"priority": 50
},
"allocate": {
"number_of_replicas": 0
},
"shrink": {
"number_of_shards": 1
},
"forcemerge": {
"max_num_segments": 1
}
}
}
}
}
}
PUT _cluster/settings
{
"transient": {
"indices.lifecycle.poll_interval": "10s"
}
}
PUT _index_template/template_demo
{
"index_patterns": ["demo-*"],
"priority": 200,
"data_stream": { },
"template": {
"settings": {
"number_of_replicas": 1,
"number_of_shards": 3,
"index.lifecycle.name":"demo_1"
}
}
}
PUT _ingest/pipeline/add-timestamp
{
"processors": [
{
"set": {
"field": "@timestamp",
"value": "{{_ingest.timestamp}}"
}
}
]
}
PUT _data_stream/demo-ds
GET demo-ds/_search
POST demo-ds/_doc?pipeline=add-timestamp
{
"user":{
"id":"zhouyinhui"
},
"message":"this is so coo"
}
GET demo-ds/_ilm/explain
GET demo-ds/_search
DELETE _data_stream/demo-ds
POST _index_template/_simulate_index/demo-ds
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。