Skip to content

Create data stream alias with action that uses wildcard expression fails. #75456

@martijnvg

Description

@martijnvg

When creating an alias from an action that uses a wildcard expression in indices field that matches with a data stream via the update aliases api then an error occurs instead of creating the alias.

Note that error doesn't occur if a concrete data stream name is used in the indices field of an alias action.

Reproduction:

PUT /_data_stream/logs-foo-bar

GET /_cat/indices

POST /_aliases
{
    "actions": [
        {
            "add": {
                "indices": ["logs-foo-* "],
                "aliases": ["my-alias"]
            }
        }
    ]
}

Result:

{
    "error": {
        "root_cause": [
            {
                "type": "index_not_found_exception",
                "reason": "no such index [logs-foo-*]",
                "index_uuid": "_na_",
                "index": "logs-foo-*"
            }
        ],
        "type": "index_not_found_exception",
        "reason": "no such index [logs-foo-*]",
        "index_uuid": "_na_",
        "index": "logs-foo-*"
    },
    "status": 404
}

Expected behaviour is that an alias is created with the name my-alias that points to data stream with the name logs-foo-bar.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions