Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tag "truncated" to "log.flags" if incoming line is longer than configured limit #7991

Prev Previous commit
Next Next commit
fix variable
  • Loading branch information
kvch committed Aug 27, 2018
commit 496ebe4ff288a5a6ef9b82757d3a8b5dd92f1c61
12 changes: 6 additions & 6 deletions filebeat/reader/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ func (m *Message) AddFields(fields common.MapStr) {
return
}

if msg.Fields == nil {
msg.Fields = common.MapStr{}
if m.Fields == nil {
m.Fields = common.MapStr{}
}
msg.Fields.Update(fields)
m.Fields.Update(fields)
}

// AddTagsWithKey adds tags to the message with an arbitrary key.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment on exported method Message.AddFlagsWithKey should be of the form "AddFlagsWithKey ..."

Expand All @@ -68,9 +68,9 @@ func (m *Message) AddTagsWithKey(key string, tags []string) error {
return nil
}

if msg.Fields == nil {
msg.Fields = common.MapStr{}
if m.Fields == nil {
m.Fields = common.MapStr{}
}

return common.AddTagsWithKey(msg.Fields, key, tags)
return common.AddTagsWithKey(m.Fields, key, tags)
}