Skip to content

Commit

Permalink
add more info to String
Browse files Browse the repository at this point in the history
  • Loading branch information
kvch committed Apr 1, 2019
1 parent 4179120 commit 40d5258
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libbeat/processors/actions/truncate_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,11 @@ func (f *truncateFields) truncateCharacters(value []byte) ([]byte, error) {
}

func (f *truncateFields) String() string {
return "truncate_fields=" + strings.Join(f.config.Fields, ", ")
var limit string
if f.config.MaxBytes > 0 {
limit = fmt.Sprintf("max_bytes=%d", f.config.MaxBytes)
} else {
limit = fmt.Sprintf("max_characters=%d", f.config.MaxChars)
}
return "truncate_fields=" + strings.Join(f.config.Fields, ", ") + limit
}

0 comments on commit 40d5258

Please sign in to comment.