Last active
August 29, 2015 14:26
-
-
Save shaharmor/b51a9297337133efab5f to your computer and use it in GitHub Desktop.
Elasticsearch scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPUT localhost:9200/logstash-YYYY.MM.DD/_settings -d '{ "index.cache.query.enable": true }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YEAR_START=2015 | |
YEAR_END=2015 | |
MONTH_START=1 | |
MONTH_END=12 | |
DAY_START=1 | |
DAY_END=31 | |
for year in $(seq -f "%04g" $YEAR_START $YEAR_END) | |
do | |
for month in $(seq -f "%02g" $MONTH_START $MONTH_END) | |
do | |
for day in $(seq -f "%02g" $DAY_START $DAY_END) | |
do | |
echo "$year.$month.$day" | |
done | |
done | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPOST "localhost:9200/logstash-YYYY.MM.DD/_optimize?max_num_segments=1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# beofre using this script you must install the reindex module from https://github.com/codelibs/elasticsearch-reindexing | |
# using $ES_HOME/bin/plugin --install org.codelibs/elasticsearch-reindexing/1.7.0 | |
curl -XPOST "localhost:9200/logstash-YYYY.MM.DD/_reindex/logstash-YYYY.MM.DD-old/?wait_for_completion=true" | |
curl -XDELETE "localhost:9200/logstash-YYYY.MM.DD/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment