As per the title, ILM simply does not work, or at least it doesn't work according to what Kibana or the docs make you believe should work.
I can create a lifecycle policy and attach a index but it will never roll over. I also tried doing it as per the docs. Create a template, create the policy, attach template to policy, manually create the first index and then have logstash index to myindex-000001 along with the ilm policy settings in the output but that too creates no rollover indexes.
The legibility of the docs is not good. Required settings are hard to spot and too strung out over long pages.
The reason there is now a second index is because I forced the lifecycle policy to run again. That created the second index but after that no new index is created nor is the old index deleted.
ILM is not really intended to be used on 1m lifecycle. I Do not believe You will achieve your desired behavior. My understanding is that ILM is an opportunistic background task it is not preemptive so it is not going to execute on the exact time frame.
It's designed to work on the order of hours or days not minutes.
Apologies. Ah I suspected This was for testing I've written several other threads on this topic where folks are trying to test using minutes and perhaps you're right The documents could be better.
When you use normal numbers the ILM will work plus or minus a couple percents in either time or size of the index.
You can always open an issue for Kibana and / or the documentation and supply suggestions that's part of the community and an open source project.
I have given suggestions numerous times. I don't mind because in the end Elastic becomes a better product but at the same time I am a paying customer, I expect documentation to at least give me basic working examples. In case of ILM that simply isn't the case. I now have one policy that for some reason works and another one that doesn't even though I followed the exact same steps. Logstash trows an alias related error but than the next problem is the logstash documentation doesn't really explain how, or if you need to set up the ilm inside logstash as well.
At this point I pretty much wasted a day on trying to figure something out which should be very simple. Your UI lets you create a policy and link a index. It doesn't mention anything else being required but that simply won't work.
@Sjaak01 ILM uses a poll interval of 10 minutes (indices.lifecycle.poll_interval) which defaults to 10 minutes.
The times in the phases are expected to be (considerably) larger than that, as @stephenb said. Your rollover with 1m and deletion with 5m is not helping that and could cause issues.
We don't recommend changing this value for production, but for a test you could set it to 1 minute.
Make your rollover be 2 or 3 minutes and your deletion 5 minutes.
Also your Logstash output is pointing to the ILM settings AND to the index name. So there might be a conflict, or simply the ILM settings are being ignored, making ingestion always happen in v2-testdiag-000001, not in the alias, which should change after rollover.
Remove the index name in the test. Logstash will create the index with the proper name and policy and actually write to the rollover alias, not to the first index as you specified.
I want to apoligize because I was overly rude in my previous post.
I gave it some time and looked at it again and everything is working now. As mentioned before, the ILM can be a bit slow so for anyone that wants to test, I suggest 1 hour intervals.
What I had to do is is 1) create a index template 2) create the ILM 3) manually create the first index matching the template. The latter seems to be important for ILM to actually work.
It might be a idea to make the explanation in the GUI a bit clearer because its easy to think just setting it up using the UI is enough.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.