Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save TarasKindrat/bce45943637161065e804e33e7688cf6 to your computer and use it in GitHub Desktop.
Save TarasKindrat/bce45943637161065e804e33e7688cf6 to your computer and use it in GitHub Desktop.
Delete unassigned shards from Elasticsearch
#!/bin/bash
curl -XDELETE `curl http://localhost:9200/_cat/shards?h=index,shard,prirep,state,unassigned.reason | grep UNASS | awk '{print "http://localhost:9200/" $1}'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment