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

Update Thrift protocol to use ECS fields #10125

Merged
merged 3 commits into from
Jan 18, 2019

Conversation

andrewkroh
Copy link
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)
@@ -1130,22 +1137,15 @@ func (thrift *thriftPlugin) publishTransactions() {
t.reply.exceptions)
}
}
if len(t.reply.notes) > 0 {
fields["notes"] = t.reply.notes
if len(t.reply.notes) == 1 {
Copy link
Member

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
Member

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
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
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
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