Skip to content

elastic_daily_index will help you rollover the index daily and delete the old index according you configurations.

License

Notifications You must be signed in to change notification settings

bubble501/elastic_daily_index

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elastic_daily_index

We often need to delete or archive the old index when handle the periodic data such as logs. elastic_daily_index will help you rollover the index daily and delete the old index according your configurations. the default value is keeping index newer than 14 days. you can change the value of self.age according your requirement.

quick start

  1. clone the local disk, we assume the default base directory is /opt
git clone https://github.com/bubble501/elastic_daily_index.git
  1. install the required package.
pip3 install -r requirements.txt
  1. create the needed index template, alias and index using the following script.
python daily_index.py demo --action create
  1. edit the rollover.sh based on your index name.
  2. Add the follow line to your cron job using crontab -e.
00 1 * * * /opt/elastic_daily_index/rollover.sh
  1. Now you can use index alias demo_write as the index name of your index writer and index alias demo_search as the index name of your index reader.

About

elastic_daily_index will help you rollover the index daily and delete the old index according you configurations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published