Skip to content

Commit

Permalink
Merge pull request #16 from bhuisgen/master
Browse files Browse the repository at this point in the history
Remove open and closed indices
  • Loading branch information
imperialwicket committed Jan 20, 2016
2 parents 0badba3 + 202f439 commit 8448093
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion elasticsearch-remove-old-indices.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ if [ -n "$ERROR" ]; then
fi

# Get the indices from elasticsearch
INDICES_TEXT=`curl -s "$ELASTICSEARCH/_status?pretty=true" | grep $GREP | grep -v \"index\" | sort -r | awk -F\" {'print $2'}`
INDICES_TEXT=`curl -s "$ELASTICSEARCH/_cat/indices?v" | awk '/'$GREP'/{match($0, /[:blank]*('$GREP'.[^ ]+)[:blank]*/, m); print m[1];}' | sort -r`

if [ -z "$INDICES_TEXT" ]; then
echo "No indices returned containing '$GREP' from $ELASTICSEARCH."
Expand Down

0 comments on commit 8448093

Please sign in to comment.