Skip to content

Instantly share code, notes, and snippets.

@ricsiga
Created June 20, 2016 13:36
Show Gist options
  • Save ricsiga/f212d53231d012f10b74c8b57acafb83 to your computer and use it in GitHub Desktop.
Save ricsiga/f212d53231d012f10b74c8b57acafb83 to your computer and use it in GitHub Desktop.
delete old filebeat indices from elasticsearch
#!/bin/bash
index=$(date --date='14 days ago' +%Y.%m.%d)
curl -s -XDELETE "http://localhost:9200/filebeat-$index?pretty"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment