From c9b76681c31b0ef216479b8d3a37a0db11ac9622 Mon Sep 17 00:00:00 2001 From: suxb201 Date: Wed, 28 Sep 2022 17:46:00 +0800 Subject: [PATCH] filter REPLCONF command for AWS ElastiCache and OPINFO command for Aliyun Redis 4.0 --- filters/aliyun.lua | 8 ++++++++ filters/aws.lua | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 filters/aliyun.lua create mode 100644 filters/aws.lua diff --git a/filters/aliyun.lua b/filters/aliyun.lua new file mode 100644 index 0000000..8ab684b --- /dev/null +++ b/filters/aliyun.lua @@ -0,0 +1,8 @@ +-- Aliyun Redis 4.0: skip OPINFO command +function filter(id, is_base, group, cmd_name, keys, slots, db_id, timestamp_ms) + if cmd_name == "OPINFO" then + return 1, db_id -- disallow + else + return 0, db_id -- allow + end +end \ No newline at end of file diff --git a/filters/aws.lua b/filters/aws.lua new file mode 100644 index 0000000..23101c3 --- /dev/null +++ b/filters/aws.lua @@ -0,0 +1,8 @@ +-- ElastiCache: skip REPLCONF command +function filter(id, is_base, group, cmd_name, keys, slots, db_id, timestamp_ms) + if cmd_name == "REPLCONF" then + return 1, db_id -- disallow + else + return 0, db_id -- allow + end +end \ No newline at end of file