Handle more Redis RESP3 protocol pieces

This passes the "minimum protocol version" along in the reply and adds
support for attributes, which were added relatively recently.
This commit is contained in:
Evan Typanski 2025-06-26 11:52:05 -04:00
parent b34d3ff2f0
commit 64443e5e5a
13 changed files with 115 additions and 30 deletions

View file

@ -0,0 +1,19 @@
# @TEST-DOC: Test Redis protocol handling with replies with attributes
# @TEST-REQUIRES: have-spicy
#
# @TEST-EXEC: zeek -b -r $TRACES/redis/attr.pcap %INPUT >output
# @TEST-EXEC: btest-diff output
# @TEST-EXEC: btest-diff redis.log
# IMPORTANT: The test data was made synthetically, since real commands that
# return attributes may be version-specific. Real traffic would be better.
@load base/protocols/redis
event Redis::reply(c: connection, data: Redis::ReplyData)
{
if ( ! data?$attributes )
print "Got data:", data$value;
else
print "Got data:", data$value, "with attributes:", data$attributes;
}