#garder les 10 plus récent
This commit is contained in:
parent
ad8e0202b0
commit
3587386105
|
@ -631,7 +631,8 @@ Voici un exemple qui pour les index nommés `logstash-*`, ne va conserver que le
|
||||||
~~~{.bash}
|
~~~{.bash}
|
||||||
#!/bin/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
|
for index in ${indices}; do
|
||||||
# echo Delete ${index}
|
# echo Delete ${index}
|
||||||
|
|
Loading…
Reference in a new issue