Skip to content

Commit

Permalink
Remove open and closed indices
Browse files Browse the repository at this point in the history
Signed-off-by: Boris HUISGEN <[email protected]>
  • Loading branch information
Boris HUISGEN committed Jan 20, 2016
1 parent 0badba3 commit 202f439
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 202f439

Please sign in to comment.