add alias+datastream rollover, and auto rollover on index tpl change (#40)

fixes #37
This commit is contained in:
T. von Dein
2026-06-16 13:48:41 +02:00
parent 97004e0957
commit ce4a60f8e2
8 changed files with 365 additions and 50 deletions

View File

@@ -113,6 +113,12 @@ https://www.elastic.co/docs/reference/elasticsearch/index-settings
Destination: &conf.AutoCreate,
Aliases: []string{"a"},
},
&cli.BoolFlag{
Name: "rollover",
Usage: "automatically rollover associated aliases",
Destination: &conf.Rollover,
Aliases: []string{"R"},
},
&cli.StringFlag{
Name: "mode",
Usage: "index mode, one of: standard, timeseries, logsdb or lookup",
@@ -171,8 +177,10 @@ https://www.elastic.co/docs/reference/elasticsearch/index-settings
return fmt.Errorf("no name specified")
}
if !slices.Contains([]string{"standard", "timeseries", "logsdb", "lookup"}, conf.Mode) {
return errors.New("mode must be one of: standard, timeseries, logsdb or lookup")
if conf.Mode != "" {
if !slices.Contains([]string{"standard", "timeseries", "logsdb", "lookup"}, conf.Mode) {
return errors.New("mode must be one of: standard, timeseries, logsdb or lookup")
}
}
mappings := args.Slice()[1:]