Skip to content

Instantly share code, notes, and snippets.

@melnikk
Created May 17, 2017 13:32
Show Gist options
  • Save melnikk/6dfc878b28fe2ab82d175713c00c5ea0 to your computer and use it in GitHub Desktop.
Save melnikk/6dfc878b28fe2ab82d175713c00c5ea0 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