Skip to content

Update Thrift protocol to use ECS fields#10125

Merged
andrewkroh merged 3 commits intoelastic:masterfrom
andrewkroh:feature/pb/thrift-ecs
Jan 18, 2019
Merged

Update Thrift protocol to use ECS fields#10125
andrewkroh merged 3 commits intoelastic:masterfrom
andrewkroh:feature/pb/thrift-ecs

Conversation

@andrewkroh
Copy link
Copy Markdown
Member

@andrewkroh andrewkroh commented Jan 16, 2019

That dashboard was updated too.

Here's a summary of what fields changed.

Part of #7968

Changed

  • bytes_in -> source.bytes
  • bytes_out -> destination.bytes
  • notes -> error.message
  • responsetime -> event.duration (unit are now nanoseconds)

Added

  • source
  • destination
  • event.dataset = thrift
  • event.end
  • event.start
  • network.community_id
  • network.transport = tcp
  • network.protocol = thrift
  • network.bytes
  • network.type

Unchanged Packetbeat Fields

  • method
  • path
  • query
  • status
  • type = thrift (we might remove this since we have event.dataset)

That dashboard was updated too.

Here's a summary of what fields changed.

Part of elastic#7968

Changed

- bytes_in -> source.bytes
- bytes_out -> destination.bytes
- notes -> error.message
- responsetime -> event.duration (unit are now nanoseconds)

Added

- source
- destination
- event.dataset = thrift
- event.end
- event.start
- network.community_id
- network.transport = tcp
- network.protocol = thrift
- network.bytes
- network.type

Unchanged Packetbeat Fields

- method
- path
- query
- status
- type = thrift (we might remove this since we have event.dataset)
@andrewkroh andrewkroh force-pushed the feature/pb/thrift-ecs branch from 00d2576 to d7e73fc Compare January 16, 2019 22:05
}
if len(t.reply.notes) > 0 {
fields["notes"] = t.reply.notes
if len(t.reply.notes) == 1 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This becomes a pattern across protocols :-)

assert all([o["source.bytes"] > 0 for o in objs])
assert all([o["destination.bytes"] > 0 for o in objs[0:14]])
assert all([o["destination.bytes"] > 0 for o in objs[16:]])
#assert objs[14]["destination.bytes"] == 0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Commeted out on purpose? Also 2 more below.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Zero values are automatically omitted based on how I marshaling these fields. Effectively it's like json:"destination.bytes,omitempty". I meant to remove these lines. Will fix.

Copy link
Copy Markdown
Contributor

@webmat webmat left a comment

Choose a reason for hiding this comment

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

LGTM if the comments noted by Nic were there on purpose.

One note: populating error.message is fine with me, I think this is how it should be used. Ingest Node suggests in its documentation to output IN errors at error.message as well, though. So far, it looks like people always cargo cult that part, I've never seen a pipeline that put IN's error message elsewhere.

Packetbeat doesn't use Ingest Node, correct? If that's true, I think we're good here.

The zero value fields are automatically removed from the resulting event.
@andrewkroh
Copy link
Copy Markdown
Member Author

Packetbeat doesn't use Ingest Node, correct?

That's correct. And Packetbeat is using error.message to indicate internal PB errors/warnings like some packets were missed rather than errors responses in the protocol like invalid sql query.

@andrewkroh andrewkroh merged commit 2697d46 into elastic:master Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants