Skip to content

Instantly share code, notes, and snippets.

@dallasmarlow
Created October 9, 2015 15:43
Show Gist options
  • Save dallasmarlow/aecdd70ebe2c4c155a20 to your computer and use it in GitHub Desktop.
Save dallasmarlow/aecdd70ebe2c4c155a20 to your computer and use it in GitHub Desktop.
require 'elasticsearch'
es = Elasticsearch::Client.new host: 'http://xx.xx.xx.xxx'
es.indices.get_aliases.keys.each do |idx|
if ['asp', 'html', 'perl', 'php', 'pl', 'cgi'].include?(idx.split('.').last)
es.indices.delete index: idx
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment