Automatic index count limit on data stream

Is it possible to limit the number of backing indexes on a data stream, automatically removing older indexes when new ones are created?

I tried to use an ISM policy but can’t find any condition to count the number of existing indexes on a data stream.


@pjs ISM policy transitions are based on the number of documents, index size, and index age. It can’t be configured against a number of indices.