From 35873861050dbf8c61578f4fa441f2133d38843d Mon Sep 17 00:00:00 2001 From: pdiogoantunes Date: Tue, 28 Nov 2017 11:54:28 +0100 Subject: [PATCH] =?UTF-8?q?#garder=20les=2010=20plus=20r=C3=A9cent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HowtoElasticsearch.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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}