Elasticsearch Index Management

PUT _opendistro/_ism/policies/test-archive
{
"policy": {
"description": "A simple default policy that archives logs after 15 days.",
"default_state": "hot",
"states": [
{
"name": "hot",
"actions": [],
"transitions": [
{
"state_name": "delete",
"conditions": {
"min_index_age": "15d"
}
}
]
},
{
"name": "delete",
"actions": [
{
"delete": {}
}
],
"transitions": []
}
],
"ism_template": {
"index_patterns": ["logs-to-be-archive-*"],
"priority": 100
}
}
}
PUT _ilm/policy/test-archive
{
"policy": {
"_meta": {
"description": "A simple default policy that archives logs after 15 days.",
"project": {
"name": "myProject",
"department": "myDepartment"
}
},
"phases": {
"delete": {
"min_age": "15d",
"actions": {
"delete": {}
}
}
}
}
}
PUT _index_template/timeseries_template
{
"index_patterns": ["logs-to-be-archive-*"],
"template": {
"settings": {
"index.lifecycle.name": "test-archive"
}
}
}

--

--

--

Working as Cloud Architect & Software enthusiastic

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

2 Year Journey

Leetcode Solutions

Git Happens tryhackme

Animation of CSS gradients

READ/DOWNLOAD$= Pro SQL Server on Linux: Including

How to Speed up Your Computer

NEAR Hackathon Partners: Announcing Aurora

Kubernetes Network Policies: A Practitioner’s Guide

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
NIRAV SHAH

NIRAV SHAH

Working as Cloud Architect & Software enthusiastic

More from Medium

How Zerocode helped testing Disaster Recovery Solution for AWS MSK ?

AWS Parameter Store — How to get all parameters at a given path

How to Connect Elastic Sink Connector with Kafka

Prerequisites to Cloud-native software