Skip to content

Instantly share code, notes, and snippets.

@portante
Last active June 7, 2017 13:06
Show Gist options
  • Select an option

  • Save portante/550eafc4d6b535116107717908d732a6 to your computer and use it in GitHub Desktop.

Select an option

Save portante/550eafc4d6b535116107717908d732a6 to your computer and use it in GitHub Desktop.
Close indices matching a given pattern
#!/bin/bash
# Usage: close.sh \*.2017.04.\*
pattern=$1
ES_URL='https://localhost:9200'
curl_post='curl -s -X POST --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key'
$curl_post $ES_URL/$pattern/_close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment