Simple Go application to clean old indices from Elasticsearch
1.8K
Small Go application to clear old Elasticsearch indices.
As descibed on my blog, if I want to keep only a certain amount of logs collected into Elasticsearch, I need to periodically delete the old indices that correspond to days too far in the past. This can be done manually with a simple curl command.
$ curl -X DELETE http://elasticsearch:9200/fluentd-20180412
The application is available on Docker Hub, and to run it, you can:
docker run --rm -it \
-e BASE_URL=http://elasticsearch:9200 \
-e PATTERN=logstash-.* \
-e MAX_INDICES=14 \
-e INTERVAL=12h \
-e TIMEOUT=30s \
rycus86/elasticsearch-cleaner
The available environment variables for the configuration are:
MIT
docker pull rycus86/elasticsearch-cleaner:latest