HOW-TO create an index automatically per-month

Good morning guys,

Could you please possibly advise on how to achieve index management on a monthly basis ?

For example, if the index alias is configured like

{
    "actions": [
        {
            "add": {
                "index": "{{ item }}",
                "index_routing": "IXmac:cache",
                "search_routing": "IXmac:cache",
                "alias": "TheApp"
            }
        },
        {
            "add": {
                "index": "{{ item }}",
                "index_routing": "IXmac:cache",
                "search_routing": "IXmac:cache",
                "alias": "IXmac"
            }
        }
    ]
}

How the index should be configured in order to
[1] automatically create an index every month
[2] when querying from Kibana or via curl, the time filter of the query spans more than 1 month, will elasticsearch automatically query the related indices ?

Nikos

The only way to create a new index is to request one, there is no way for ES to do that itself.

You can rely on automatic index creation like logstash does, meaning that the first document that you index into a new index, will cause the index creation as well. The action.auto_create_index allows to control which indices can and cannot be created automatically. As for aliases and routing, you can set up an index template that adds aliases to such indices and routing values too.

Cheers
Luca

Thank you @javanna @warkolm for the info. Noted.