Update Redis protocol to use ECS fields#10126
Conversation
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)
04638a6 to
c3c54d8
Compare
webmat
left a comment
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
dev-tools/ecs-migration.yml
Outdated
| ## Redis | ||
| - from: redis.error | ||
| to: error.message | ||
| alias: true |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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.
Here's a summary of what fields changed.
Part of #7968
Changed
redis.error -> error.message (alias added)Added
Unchanged Packetbeat Fields