Skip to content

Commit b2ead63

Browse files
committed
Add filter by ILM policy
1 parent 0dce13f commit b2ead63

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

cmd_ilm_list.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ func ilmList(ctx context.Context, cmd *cli.Command) error {
2626
password := cmd.String("password")
2727

2828
phase := cmd.String("phase")
29+
ilmPolicy := cmd.String("ilm-policy")
2930
sortColumns := cmd.StringSlice("sort")
3031
minSizeStr := cmd.String("min-size")
3132
minAge := time.Duration(cmd.Int("min-age-days")) * 24 * time.Hour
@@ -114,6 +115,10 @@ func ilmList(ctx context.Context, cmd *cli.Command) error {
114115
continue
115116
}
116117

118+
if ilmPolicy != "" && ilmPolicy != *managed.Policy {
119+
continue
120+
}
121+
117122
size := sizes[index]
118123

119124
if size < minSize {

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ func run(ctx context.Context, args []string) error {
6868
Aliases: []string{"p"},
6969
Usage: "Filter to only include indices in the given phase",
7070
},
71+
&cli.StringFlag{
72+
Name: "ilm-policy",
73+
Aliases: []string{"i"},
74+
Usage: "Filter to only include indices with the given ILM policy attached",
75+
},
7176
&cli.StringSliceFlag{
7277
Name: "sort",
7378
Aliases: []string{"s"},

0 commit comments

Comments
 (0)