diff --git a/HowtoElasticsearch.md b/HowtoElasticsearch.md index 74be28de..cf02a0e3 100644 --- a/HowtoElasticsearch.md +++ b/HowtoElasticsearch.md @@ -631,7 +631,8 @@ Voici un exemple qui pour les index nommés `logstash-*`, ne va conserver que le ~~~{.bash} #!/bin/bash -indices=$(curl http://127.0.0.1:9200/_cat/indices/logstash-*?h=i | sort | head -n -20) +#garder les 10 plus récent +indices=$(curl http://127.0.0.1:9200/_cat/indices/logstash-*?h=i | sort | head -n -10) for index in ${indices}; do # echo Delete ${index}