Skip to content

Instantly share code, notes, and snippets.

@martinmares
Last active April 9, 2025 13:27
Show Gist options
  • Save martinmares/f5d57dba541da48d1cd3974a3d64d290 to your computer and use it in GitHub Desktop.
Save martinmares/f5d57dba541da48d1cd3974a3d64d290 to your computer and use it in GitHub Desktop.
PUT _index_template/tsm-log-index-template
{
"template": {
"settings": {
"index": {
"lifecycle": {
"name": "tsm-log-lifecycle-policy"
},
"codec": "best_compression",
"number_of_shards": "1",
"number_of_replicas": "0"
}
},
"mappings": {
"properties": {
"correlationID": {
"type": "keyword"
},
"ticketOrPew": {
"type": "keyword"
},
"tsm": {
"properties": {
"duration": {
"type": "integer",
"ignore_malformed": false,
"coerce": true
}
}
}
}
},
"aliases": {}
}
}
PUT _ilm/policy/tsm-log-lifecycle-policy
{
"policy": {
"phases": {
"hot": {
"min_age": "0ms",
"actions": {}
},
"cold": {
"min_age": "30d",
"actions": {}
},
"delete": {
"min_age": "90d",
"actions": {
"delete": {
"delete_searchable_snapshot": true
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment