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 Redis protocol to use ECS fields #10126

Merged
merged 2 commits into from
Jan 18, 2019

Conversation

andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented Jan 16, 2019

Here's a summary of what fields changed.

Part of #7968

Changed

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

Added

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

Unchanged Packetbeat Fields

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

Here's a summary of what fields changed.

Part of elastic#7968

Changed

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

Added

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

Unchanged Packetbeat Fields

- method
- resource
- path
- query
- status
- type = redis (we might remove this since we have event.dataset)
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.

I'd prefer to see normalization of the method field towards lowercase instead of towards uppercase. Even if not defined in ECS, using lowercase will be more consistent.

Also same minor warning about error.message as for Thrift.


fields := evt.Fields
fields["type"] = pbf.Event.Dataset
fields["method"] = common.NetString(bytes.ToUpper(requ.method))
Copy link
Contributor

Choose a reason for hiding this comment

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

We're actually going with lowercase, to normalize text in general. Even though this isn't an ECS field, I think it would make sense to lowercase instead of uppercasing here as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm hesitant to change this now because it's not strictly required for ECS. It was already doing a ToUpper so this isn't a change I introduced.

It probably would make sense to normalize the common fields from all the protocols (method, status, path, query). If we do that it would be nice to have it done is a single place in the code path.

Copy link
Contributor

@webmat webmat Jan 18, 2019

Choose a reason for hiding this comment

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

Ok, since it was already like this, and ECS doesn't cover that field, I'm fine if you prefer to leave it for now.

However as ECS continues to cover more areas, I think we will continue suggesting normalizing to lowercase.

## Redis
- from: redis.error
to: error.message
alias: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Same minor heads up as for Thrift error messages. Ingest Node suggests outputting IN errors in error.message. If Pb doesn't use IN at all, I think we're good.

What you're doing here is the correct usage for error.message, IN example is what will have to change.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going to undo the error.message change I did here. It doesn't align well with the other protocols and makes the value of the field confusing because you are not sure if it's a protocol error (bad SQL query) or a Packetbeat error (packet loss detected).

This made it hard to tell the difference between Packetbeat processing errors and protocol level errors.

fields := evt.Fields
fields["type"] = pbf.Event.Dataset
fields["method"] = common.NetString(bytes.ToUpper(requ.method))
Copy link
Contributor

@webmat webmat Jan 18, 2019

Choose a reason for hiding this comment

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

Ok, since it was already like this, and ECS doesn't cover that field, I'm fine if you prefer to leave it for now.

However as ECS continues to cover more areas, I think we will continue suggesting normalizing to lowercase.

@andrewkroh andrewkroh merged commit 4cb81a5 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