Time based indexes and automatic deletion of created indexes

This is a pretty common situation people do. The general way to deal with this is with curator and setting up time-based indices (e.g. 1 per day). Curator has a delete_indices action, and the example does more or less exactly what you're looking for: deleting an index matching some pattern that is older than N days.