Long story story short, I had to set setup.ilm.enabled: false
in order for my beats not 404 when pushing data to my Elasticsearch stack that is behind an Apache reverse proxy. (Apache is set up to use LDAP auth, which is why I don't just use the basic security built into ES.)
So I have attempted to manually configure ILM.
After creating policies and telling my indices to use them, they all complain with errors like this:
Index lifecycle error
illegal_argument_exception: index.lifecycle.rollover_alias [filebeat] does not point to index [filebeat-7.3.2-2019.11.06]
This is my Filebeat policy:
PUT _ilm/policy/filebeat-lane-custom
{
"policy": {
"phases": {
"hot": {
"min_age": "0ms",
"actions": {
"rollover": {
"max_age": "30d",
"max_size": "50gb"
},
"set_priority": {
"priority": 100
}
}
},
"warm": {
"actions": {
"allocate": {
"number_of_replicas": 1,
"include": {},
"exclude": {}
},
"forcemerge": {
"max_num_segments": 1
},
"set_priority": {
"priority": 50
},
"shrink": {
"number_of_shards": 1
}
}
},
"cold": {
"min_age": "90d",
"actions": {
"allocate": {
"number_of_replicas": 0,
"include": {},
"exclude": {}
},
"freeze": {},
"set_priority": {
"priority": 0
}
}
}
}
}
}
While writing this post, I noticed that I had not created a filebeat-* template, but I had done so for metricbeat. Looking at some of my metricbeat indices, they have this error:
Index lifecycle error
illegal_argument_exception: Rollover alias [metricbeat] can point to multiple indices, found duplicated alias [[metricbeat]] in index template [metricbeat]
My metricbeat template can be found here: https://gist.github.com/jerrac/be045f7c2cc6de4c564fca4cb875243a
My metricbeat policy is the same as filebeat, just replace "file" with "metric".
I've read the docs, mostly, I'm working my way through them again now, but I think everything boils down to these steps:
- Create a life cycle policy.
- Initialize a -00001 index for auto incrementing.
- Create a template for your index pattern, like
filebeat-*
. - Apply the policy to existing indices via
index.lifecycle.name
andindex.lifecycle.rollover_alias
- In my case I set name to the name of the policy, and rollover_alias to the first part of the incrementing index.
I'm obviously missing something. Anyone have a clue? A section of the docs I haven't grasped yet?
Is it possible to have more than one index template for a single index? As in the template managed by filebeat, plus a template that applies only the lifecycle settings? I tried that just now for filebeat, but it doesn't seem to have changed anything yet. I'm not sure if that' just because it takes time for it to be triggered, or something else...