How to correct custom logstash index name for use by ILM

I have a custom logstash index named asa-%date%. I have attempted to apply an ILM policy to it, but I get an error when it attempts to apply. According to an elastic team member in another thread this is because ILM expects the index name to have a versioning number appended to the end. Such as asa-2020.08.25-00001

How do I apply the versioning "field" option to my custom name? The index for beats out of the box seems to apply this but the documentation simply states:

Optional index name. The default is "filebeat" plus date

and generates [filebeat-]YYYY.MM.DD keys.

Where and how does the versioning number get applied to the index name?

Sharing the error, and policy and template would be helpful.

Sorry, here is the other thread that details my problem exactly, with a hint at a solution but I unfortunately needed more details concerning fixing the index name:

Here is my error:

illegal_argument_exception: index.lifecycle.rollover_alias [filebeat-7.8.0] does not point to index [asa-2020.08.18]

My simple policy is this:

PUT _ilm/policy/Delete-After-7 { "policy": { "phases": { "hot": { "min_age": "0ms", "actions": {} }, "delete": { "min_age": "7d", "actions": { "delete": {} } } } } }

Not sure how to format about code, the back tic is not working for me. Apologies.

Also not sure how to post template as there is tons of information, however it is the default Filbeat 7.8 template with the only change that I applied the template to also include "asa-*" which is not functioning as far as ILM

Did you bootstrap the initial index?

I did not manually bootstrap the original index. The original index was simply a default setup of an Filebeat shipper with ILM enabled as part of the config so I do not know if bootstrapping automatically takes place as part of that process. The ILM process for that index appears to be working.

I assigned my non standard index to this default Filebeat 7.8 Index Template that was automatically created. I was hoping this would let it sort of piggy back on to the working index. Obviously it is more complicated than that.

Ok, you should be able to run something like;

PUT /my_logs_index-000001/_alias/logs

To assign the logs alias to the my_logs_index-000001 index. Just replace that with your index and alias as needed.