Skip to content
HALOWERK

Codewerk

redis key audit

Works on a key list you export yourself (e.g. SCAN with TTL, MEMORY USAGE, TYPE and HLEN/ZCARD/SCARD/LLEN) as JSON or CSV; nothing connects to Redis. Groups keys by prefix and by pattern (numeric, UUID and hex segments become {id}) with bytes, share, keys without TTL and average TTL. Findings: keys without TTL per prefix (warning for prefixes such as cache, session, lock, token), big strings and collections with the thresholds of Huawei Cloud DCS "Detecting and Handling Big Keys and Hot.

POST https://code.halowerk.com/v1/redis-key-audit

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
keysarrayNo
csvstringNoAlternative to keys: lines key,ttl,bytes[,type[,elements[,max_element_bytes]]], optional header row.
separatorstringNo
prefix_depthintegerNo
big_string_bytesintegerNo
big_collection_elementsintegerNo
big_total_bytesintegerNo
long_key_bytesintegerNo
expiry_cluster_minintegerNo
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "keys": {
      "type": "array",
      "maxItems": 20000,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "ttl"
        ],
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 65536
          },
          "ttl": {
            "type": "integer",
            "minimum": -2,
            "description": "Seconds; -1 = no expiry, -2 = key missing."
          },
          "bytes": {
            "type": "integer",
            "minimum": 0,
            "description": "MEMORY USAGE in bytes."
          },
          "type": {
            "type": "string",
            "enum": [
              "string",
              "hash",
              "list",
              "set",
              "zset",
              "stream",
              "json",
              "other"
            ]
          },
          "elements": {
            "type": "integer",
            "minimum": 0
          },
          "max_element_bytes": {
            "type": "integer",
            "minimum": 0
          }
        }
      }
    },
    "csv": {
      "type": "string",
      "maxLength": 5000000,
      "description": "Alternative to keys: lines key,ttl,bytes[,type[,elements[,max_element_bytes]]], optional header row."
    },
    "separator": {
      "type": "string",
      "minLength": 1,
      "maxLength": 3,
      "default": ":"
    },
    "prefix_depth": {
      "type": "integer",
      "minimum": 1,
      "maximum": 3,
      "default": 1
    },
    "big_string_bytes": {
      "type": "integer",
      "minimum": 1,
      "default": 10240
    },
    "big_collection_elements": {
      "type": "integer",
      "minimum": 1,
      "default": 5000
    },
    "big_total_bytes": {
      "type": "integer",
      "minimum": 1,
      "default": 52428800
    },
    "long_key_bytes": {
      "type": "integer",
      "minimum": 1,
      "default": 1024
    },
    "expiry_cluster_min": {
      "type": "integer",
      "minimum": 2,
      "default": 100
    }
  }
}

Open original schema

Published input example

{
  "keys": [
    {
      "key": "session:8f3a9c2e",
      "ttl": -1,
      "bytes": 300,
      "type": "string"
    },
    {
      "key": "feed:global",
      "ttl": -1,
      "bytes": 900000,
      "type": "zset",
      "elements": 12000
    }
  ]
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’