Avoid reinventing a reindexing toolbox

Anyone know of a good CLI toolbox for doing reindexing to save #shards?

Or should I create my own set of REST API scripts for this from scratch, surely someone else should have had the same issue before :slight_smile:

EDIT: Created a few scripts to suit my purpose, maybe they can help others, if interested take a peak on my github

Example of usage could be like:

# Make sure you got your templads in place prior to reindexing,
# eg. same mapping but different index pattern matching
# (in my case I use: systemlog-* vs systemlog.*)

# batch reindexing January indicies into a yearly one
esapi-catindex -p 'systemlog-2022.01.*' | sort -k3 | awk '/-2022/{print $3}' | 
  while read idx; do
      echo $idx...
      es-reindex -L /tmp/reindx-systemlog.log -a -r 250 -s $idx -D systemlog.2022

One can then make a cron job to run nightly after index roll-over pit and reindex either yesterday's index or todate-90days or what ever is desired :slight_smile:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.