<\/figure><\/a><\/div>\n\n\n\nAfter the rollover, new index kifarunix-demo-2023.03.24-000002<\/code><\/strong> is created. Both indices will stay in the hot phase until the next check conditions are met.<\/p>\n\n\n\nThe rolled-over index, kifarunix-demo-2023.03.24-000001<\/code><\/strong>, will stay for 5 minutes in rolled-over state or the minimum age defined in the policy, after which it is moved to warm phase<\/code><\/strong>.<\/p>\n\n\n\nSince our poll interval is set to 10 minutes, by the time the next check happens, the rolled-over index, kifarunix-demo-2023.03.24-000001, will be older than the min_age<\/code><\/strong> (5 minutes) defined in the policy (in our case) and thus, rollover to warm phase<\/code><\/strong> happens.<\/p>\n\n\n\nSimilarly, it will have also completed the min_age<\/strong><\/code> (5 mins) for moving to cold phase<\/code><\/strong>. Hence, it will be moved to warm phase<\/code><\/strong> then to cold phase<\/strong><\/code> immediately.<\/p>\n\n\n\n\n[2023-03-24T23:33:10,327][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000001] from [{\"phase\":\"hot<\/strong>\",\"action\":\"complete\",\"name\":\"complete\"}] to [{\"phase\":\"warm<\/strong>\",\"action\":\"allocate\",\"name\":\"allocate\"}] in policy [kifarunix-demo]\n[2023-03-24T23:33:10,432][INFO ][o.e.c.m.MetadataUpdateSettingsService] [debian11] updating number_of_replicas to [0] for indices [kifarunix-demo-2023.03.24-000001]\n[2023-03-24T23:33:10,516][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000001] from [{\"phase\":\"warm\",\"action\":\"allocate\",\"name\":\"allocate\"}] to [{\"phase\":\"warm\",\"action\":\"allocate\",\"name\":\"check-allocation\"}] in policy [kifarunix-demo]\n[2023-03-24T23:33:10,603][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000001] from [{\"phase\":\"warm\",\"action\":\"allocate\",\"name\":\"check-allocation\"}] to [{\"phase\":\"warm\",\"action\":\"migrate\",\"name\":\"branch-check-skip-action\"}] in policy [kifarunix-demo]\n[2023-03-24T23:33:10,605][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000001] from [{\"phase\":\"warm\",\"action\":\"migrate\",\"name\":\"branch-check-skip-action\"}] to [{\"phase\":\"warm\",\"action\":\"migrate\",\"name\":\"migrate\"}] in policy [kifarunix-demo]\n[2023-03-24T23:33:10,782][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000001] from [{\"phase\":\"warm\",\"action\":\"migrate\",\"name\":\"migrate\"}] to [{\"phase\":\"warm\",\"action\":\"migrate\",\"name\":\"check-migration\"}] in policy [kifarunix-demo]\n[2023-03-24T23:33:10,872][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000001] from [{\"phase\":\"warm\",\"action\":\"migrate\",\"name\":\"check-migration\"}] to [{\"phase\":\"warm\",\"action\":\"complete\",\"name\":\"complete\"}] in policy [kifarunix-demo]<\/strong>\n[2023-03-24T23:33:10,965][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000001] from [{\"phase\":\"warm\"<\/strong>,\"action\":\"complete\",\"name\":\"complete\"}] to [{\"phase\":\"cold\"<\/strong>,\"action\":\"allocate\",\"name\":\"allocate\"}] in policy [kifarunix-demo]\n[2023-03-24T23:33:11,050][INFO ][o.e.c.m.MetadataUpdateSettingsService] [debian11] updating number_of_replicas to [0] for indices [kifarunix-demo-2023.03.24-000001]\n[2023-03-24T23:33:11,050][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000001] from [{\"phase\":\"cold\",\"action\":\"allocate\",\"name\":\"allocate\"}] to [{\"phase\":\"cold\",\"action\":\"allocate\",\"name\":\"check-allocation\"}] in policy [kifarunix-demo]\n[2023-03-24T23:33:11,140][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000001] from [{\"phase\":\"cold\",\"action\":\"allocate\",\"name\":\"check-allocation\"}] to [{\"phase\":\"cold\",\"action\":\"migrate\",\"name\":\"branch-check-skip-action\"}] in policy [kifarunix-demo]\n[2023-03-24T23:33:11,140][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000001] from [{\"phase\":\"cold\",\"action\":\"migrate\",\"name\":\"branch-check-skip-action\"}] to [{\"phase\":\"cold\",\"action\":\"migrate\",\"name\":\"migrate\"}] in policy [kifarunix-demo]\n[2023-03-24T23:33:11,333][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000001] from [{\"phase\":\"cold\",\"action\":\"migrate\",\"name\":\"migrate\"}] to [{\"phase\":\"cold\",\"action\":\"migrate\",\"name\":\"check-migration\"}] in policy [kifarunix-demo]\n[2023-03-24T23:33:11,434][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000001] from [{\"phase\":\"cold\",\"action\":\"migrate\",\"name\":\"check-migration\"}] to [{\"phase\":\"cold\",\"action\":\"complete\",\"name\":\"complete\"}] in policy [kifarunix-demo]<\/strong>\n[2023-03-24T23:33:11,523][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000001] from [{\"phase\":\"cold\",\"action\":\"complete\",\"name\":\"complete\"}] to [{\"phase\":\"delete\",\"action\":\"delete\",\"name\":\"wait-for-shard-history-leases\"}] in policy [kifarunix-demo]\n<\/code><\/pre>\n\n\n\nSo, as per our policy, the index kifarunix-demo-2023.03.24-000001<\/code><\/strong>, stays in cold phase<\/strong> 5 minutes before being moved to delete phase<\/strong>. At the same time, the second index is rolled-over and process continues.<\/p>\n\n\n\n\n[2023-03-24T23:38:10,326][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000002] from [{\"phase\":\"hot\",\"action\":\"rollover\",\"name\":\"check-rollover-ready\"}] to [{\"phase\":\"hot\",\"action\":\"rollover\",\"name\":\"attempt-rollover\"}] in policy [kifarunix-demo]\n[2023-03-24T23:38:10,415][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000001] from [{\"phase\":\"delete\",\"action\":\"delete\",\"name\":\"wait-for-shard-history-leases\"}] to [{\"phase\":\"delete\",\"action\":\"delete\",\"name\":\"cleanup-snapshot\"}] in policy [kifarunix-demo]<\/strong>\n[2023-03-24T23:38:10,492][INFO ][o.e.c.m.MetadataCreateIndexService] [debian11] [kifarunix-demo-2023.03.24-000003] creating index, cause [rollover_index], templates [kifarunix-demo], shards [1]\/[1]\n[2023-03-24T23:38:10,580][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000001] from [{\"phase\":\"delete\",\"action\":\"delete\",\"name\":\"cleanup-snapshot\"}] to [{\"phase\":\"delete\",\"action\":\"delete\",\"name\":\"delete\"}] in policy [kifarunix-demo]<\/strong>\n[2023-03-24T23:38:10,581][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000003] from [null] to [{\"phase\":\"new\",\"action\":\"complete\",\"name\":\"complete\"}] in policy [kifarunix-demo]\n[2023-03-24T23:38:10,583][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000002] from [{\"phase\":\"hot\",\"action\":\"rollover\",\"name\":\"attempt-rollover\"}] to [{\"phase\":\"hot\",\"action\":\"rollover\",\"name\":\"wait-for-active-shards\"}] in policy [kifarunix-demo]\n[2023-03-24T23:38:10,764][INFO ][o.e.c.m.MetadataDeleteIndexService] [debian11] [kifarunix-demo-2023.03.24-000001\/W8R1iYLeSCiGoQ4Cg72UHg] deleting index<\/strong>\n[2023-03-24T23:38:10,853][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000003] from [{\"phase\":\"new\",\"action\":\"complete\",\"name\":\"complete\"}] to [{\"phase\":\"hot\",\"action\":\"unfollow\",\"name\":\"branch-check-unfollow-prerequisites\"}] in policy [kifarunix-demo]\n[2023-03-24T23:38:10,853][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000002] from [{\"phase\":\"hot\",\"action\":\"rollover\",\"name\":\"wait-for-active-shards\"}] to [{\"phase\":\"hot\",\"action\":\"rollover\",\"name\":\"update-rollover-lifecycle-date\"}] in policy [kifarunix-demo]\n[2023-03-24T23:38:10,854][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000002] from [{\"phase\":\"hot\",\"action\":\"rollover\",\"name\":\"update-rollover-lifecycle-date\"}] to [{\"phase\":\"hot\",\"action\":\"rollover\",\"name\":\"set-indexing-complete\"}] in policy [kifarunix-demo]\n[2023-03-24T23:38:11,033][INFO ][o.e.c.m.MetadataMappingService] [debian11] [kifarunix-demo-2023.03.24-000003\/3y03bVJHQkOXnOLsBWURPw] create_mapping [_doc]\n[2023-03-24T23:38:11,126][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000003] from [{\"phase\":\"hot\",\"action\":\"unfollow\",\"name\":\"branch-check-unfollow-prerequisites\"}] to [{\"phase\":\"hot\",\"action\":\"rollover\",\"name\":\"check-rollover-ready\"}] in policy [kifarunix-demo]\n[2023-03-24T23:38:11,126][INFO ][o.e.x.i.IndexLifecycleTransition] [debian11] moving index [kifarunix-demo-2023.03.24-000002] from [{\"phase\":\"hot\",\"action\":\"rollover\",\"name\":\"set-indexing-complete\"}] to [{\"phase\":\"hot\",\"action\":\"complete\",\"name\":\"complete\"}] in policy [kifarunix-demo]\n<\/code><\/pre>\n\n\n\n <\/figure>\n\n\n\nSo, the first index has completed the cycle and has been deleted!<\/p>\n\n\n\n
And that should suffice to configure log retention period in ELK Stack. Just ensure that you set the right age as per your compliance requirements.<\/p>\n\n\n\n
Other Tutorials<\/h3>\n\n\n\n How to Integrate ELK Stack with TheHive<\/a><\/p>\n\n\n\nCreate Custom ELK Ingest Pipeline for Custom Log Processing<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"How do I change the log retention policy in elk stack? In this tutorial, you will learn how to configure log retention period in ELK<\/p>\n","protected":false},"author":1,"featured_media":15894,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[72,910,121],"tags":[6465,6464,6463,6467,6466,6462],"class_list":["post-14356","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-monitoring","category-elastic-stack","category-howtos","tag-configure-log-retention-period-in-elk-stack","tag-data-retention","tag-elk-data-retention-period","tag-how-do-i-change-the-log-retention-policy-in-elk-stack","tag-how-do-i-set-log-retention-in-elasticsearch","tag-log-retention-policy","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/14356"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=14356"}],"version-history":[{"count":47,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/14356\/revisions"}],"predecessor-version":[{"id":20702,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/14356\/revisions\/20702"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/15894"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=14356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=14356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=14356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}