Skip to content

Commit

Permalink
Add layouts to the String method of the timestamp processor (elastic#…
Browse files Browse the repository at this point in the history
…15504) (elastic#16846)

When dealing with autodiscover & hints, especially, that generate new configurations depending on the discovered workloads, having the `layouts` as part of the debug message is quite useful for checking what the timestamp processor is trying to match against the target field.

(cherry picked from commit 9ff5bc3)

Co-authored-by: Jorge Luis Betancourt Gonzalez <jorge-luis.betancourt@trivago.com>
  • Loading branch information
jsoriano and jorgelbg committed Mar 12, 2020
1 parent 4ad2010 commit c61369b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libbeat/processors/timestamp/timestamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ func loadLocation(timezone string) (*time.Location, error) {
}

func (p *processor) String() string {
return fmt.Sprintf("timestamp=[field=%s, target_field=%v, timezone=%v]",
p.Field, p.TargetField, p.tz)
return fmt.Sprintf("timestamp=[field=%s, target_field=%v, timezone=%v, layouts=%v]",
p.Field, p.TargetField, p.tz, p.Layouts)
}

func (p *processor) Run(event *beat.Event) (*beat.Event, error) {
Expand Down

0 comments on commit c61369b

Please sign in to comment.