Curator would be an ideal match here.
You can find the link here – https://github.com/elastic/curator
A command like below should work just fine –
curator --host <IP> delete indices --older-than 30 --prefix "twitter-" --time-unit days --timestring '%Y-%m-%d'
You can keep in this in the CRON for removing the indices occasionally.
You can find some examples and docs here – https://www.elastic.co/guide/en/elasticsearch/client/curator/current/examples.html