Deleting datastreams periodically

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Debian opensearch 2.14.0

Describe the issue:
Hi guys,
we have 3 node cluster where we’re sending logs from servers.
We have one datastream/index for all logs every day for every environment.

I’d like to delete od datastreams and indices but my policy doesnt delete indices because they are in datastreams.

Could you help how to edit the policy to delete datastreams?

Configuration:

Relevant Logs or Screenshots:

{
    "id": "delete_after_7_days",
    "seqNo": 66941,
    "primaryTerm": 1,
    "policy": {
        "policy_id": "delete_after_7_days",
        "description": "Policy to delete indices older than 7 days",
        "last_updated_time": 1718804887897,
        "schema_version": 21,
        "error_notification": null,
        "default_state": "hot",
        "states": [
            {
                "name": "hot",
                "actions": [],
                "transitions": [
                    {
                        "state_name": "delete",
                        "conditions": {
                            "min_index_age": "7d"
                        }
                    }
                ]
            },
            {
                "name": "delete",
                "actions": [
                    {
                        "retry": {
                            "count": 3,
                            "backoff": "exponential",
                            "delay": "1m"
                        },
                        "delete": {}
                    }
                ],
                "transitions": []
            }
        ],
        "ism_template": [
            {
                "index_patterns": [
                    "*nonp_app*",
                    "*nonp_system*",
                    "*security-auditlog*"
                ],
                "priority": 2,
                "last_updated_time": 1718797014932
            }
        ]
    }
}

I tested in my local env, also didn’t work, seems ISM policy doesn’t work well with data stream, could you open an issue in this repo?

Done

1 Like