Skip to content

Instantly share code, notes, and snippets.

@troszok
Created July 18, 2013 08:47
Show Gist options
  • Select an option

  • Save troszok/6027775 to your computer and use it in GitHub Desktop.

Select an option

Save troszok/6027775 to your computer and use it in GitHub Desktop.
Cleanup logstash elasticsearch indexes
aliases = Tire::Configuration.client.get("#{Tire::Configuration.url}/_aliases")
JSON.parse(aliases.body).keys.select{|v| v =~ /^logstash/i }.each do |n|
Tire::Index.new(n).delete
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment