Regex for _close indices

Hi,
I have few indices that are named like

cloudtrail-dev-abc-2017
cloudtrail-dev-abc-2018
cloudtrail-dev-def-2017
cloudtrail-dev-def-2018

If i need to close all indices that ends with 2017. Is there a way i can do this with regex.

--
Niraj

May be

POST *2017/_close

?

@dadoonet It didn't work.

{
"error": {
    "root_cause": [
        {
            "type": "index_not_found_exception",
            "reason": "no such index",
            "index_uuid": "_na_",
            "resource.type": "index_or_alias",
            "resource.id": "*2018",
            "index": "*2018"
        }
    ],
    "type": "index_not_found_exception",
    "reason": "no such index",
    "index_uuid": "_na_",
    "resource.type": "index_or_alias",
    "resource.id": "*2018",
    "index": "*2018"
},
"status": 404

}

May be

POST *2017/_close?expand_wildcards=open

It works. Thanks a lot

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.