add multiline redactor test
@@ -202,6 +202,41 @@ another line here`,
want: map[string]string{
"data/datacollectorname": `abc 123
another line here
+`,
+ },
+ },
+ {
+ name: "custom multiline redactor",
+ Collect: &troubleshootv1beta1.Collect{
+ Data: &troubleshootv1beta1.Data{
+ CollectorMeta: troubleshootv1beta1.CollectorMeta{
+ CollectorName: "datacollectorname",
+ Exclude: multitype.BoolOrString{},
+ },
+ Name: "data",
+ Data: `xyz123
+abc
+xyz123
+xyz123
+abc`,
+ },
+ },
+ Redactors: []*troubleshootv1beta1.Redact{
+ {
+ MultiLine: []troubleshootv1beta1.MultiLine{
+ {
+ Selector: "abc",
+ Redactor: "xyz(123)",
+ },
+ },
+ },
+ },
+ want: map[string]string{
+ "data/datacollectorname": `xyz123
+abc
+123
+xyz123
+abc
`,
},
},
