When I run the command "GET filebeat-7.1.1/_ilm/explain" in Kibana console I am getting the below error .
{
"indices" : {
"filebeat-7.1.1" : {
"index" : "filebeat-7.1.1",
"managed" : true,
"policy" : "new_policy_1",
"lifecycle_date_millis" : 1566224013121,
"phase" : "hot",
"phase_time_millis" : 1569506868505,
"action" : "rollover",
"action_time_millis" : 1569506941341,
"step" : "ERROR",
"step_time_millis" : 1569584341468,
"failed_step" : "update-rollover-lifecycle-date",
"step_info" : {
"type" : "illegal_state_exception",
"reason" : "no rollover info found for [filebeat-7.1.1] with alias [filebeat-alias], the index has not yet rolled over with that alias",
"stack_trace" : """
java.lang.IllegalStateException: no rollover info found for [filebeat-7.1.1] with alias [filebeat-alias], the index has not yet rolled over with that alias
at org.elasticsearch.xpack.core.indexlifecycle.UpdateRolloverLifecycleDateStep.performAction(UpdateRolloverLifecycleDateStep.java:58)
at org.elasticsearch.xpack.indexlifecycle.ExecuteStepsUpdateTask.execute(ExecuteStepsUpdateTask.java:95)
at org.elasticsearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:47)
at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:687)
at org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:310)
at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:210)
at org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:142)
at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150)
at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188)
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:681)
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:252)
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:215)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:835)
"""
},
"phase_execution" : {
"policy" : "new_policy_1",
"phase_definition" : {
"min_age" : "0ms",
"actions" : {
"rollover" : {
"max_size" : "10gb",
"max_age" : "1d"
}
}
},
"version" : 1,
"modified_date_in_millis" : 1568361450082
}
}
}
}
I followed the below steps:
Setting up an ILM policy :
PUT _ilm/policy/new_policy_1
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_age": "1d",
"max_size": "10gb"
}
}
}
}
}
}
To create alias for index:
POST /_aliases
{
"actions" : [
{ "add" : { "index" : "filebeat-7.1.1", "alias" : "filebeat-alias" } }
]
}
Bootstrapping with new index:
PUT /%3Cfilebeat-%7Bnow%2Fs%7Byyyy-MM-dd-HH-mm-ss%7D%7D-1%3E
{
"aliases": {
"filebeat-alias":{
"is_write_index": true
}
}
}
Applying a policy to our index:
PUT _template/filebeat-7.1.1
{
"index_patterns": ["filebeat-*"],
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1,
"index.lifecycle.name": "new_policy_1",
"index.lifecycle.rollover_alias": "filebeat-alias"
}
}
PUT /_cluster/settings
{
"persistent": {
"action.auto_create_index": true
}
}
POST /filebeat-alias/_rollover
{
"conditions": {
"max_age": "1d",
"max_size": "10gb"
}
}
Kindly help me on this.