Event Timeline
Comment Actions
ended up tweaking it just a little bit so I'll leave that here just on the off chance someone else (or me) needs it
import elasticsearch import sys es = elasticsearch.Elasticsearch('https://search.svc.codfw.wmnet:9643', use_ssl=True, verify_certs=True, ca_certs=<path to certs>) for index in sys.stdin: index = index.strip() aliases= es.indices.get_alias(index,ignore_unavailable=True) if aliases and not aliases[index]['aliases']: print("Deleting index with no aliases: {}".format(index)) es.indices.delete(index) else: print("WARNING: {} has live aliases or doesn't exist: {}".format(index, aliases))