Fixes for elasticsearch 5

This commit is contained in:
dave 2017-04-21 00:40:49 -07:00
parent 190152f014
commit 4b7a0e70cc
2 changed files with 3 additions and 2 deletions

View File

@ -1 +1 @@
__version__ = "0.0.2"
__version__ = "0.0.3"

View File

@ -24,13 +24,14 @@ def delete_index(index, dry_run):
def main(url, index, days, dry_run=False):
global es_url
global logstash_pattern
if url.endswith("/"):
url = url[0:-1]
es_url = url
logstash_pattern = re.compile(r'%s\-(([0-9]{4})\.([0-9]{2})\.([0-9]{2}))' % index)
deleteBefore = datetime.now() - timedelta(days=days)
indexes = get_indices()
print(indexes)
for index in indexes:
datematch = logstash_pattern.match(index)