Delete Key-Value Pairs
Use this node to strip internal or sensitive fields from a message before forwarding it to external systems, or to clean up temporary keys added by upstream enrichment nodes. Java regular expressions let you remove entire groups of keys (e.g., all temp_* fields) with a single pattern.
Configuration
Section titled “Configuration”- Delete key-values from — required. Where to delete keys:
Message— deletes from message data.Metadata— deletes from message metadata.
- Keys — a set of key names or Java regular expression patterns. Keys not present in the source are silently ignored.
Message processing algorithm
Section titled “Message processing algorithm”- Determine the deletion target (message data or metadata).
- For each source key, check whether it matches any configured pattern.
- Remove all matching key–value pairs.
- If at least one key was removed, forward the updated message via
Success. Otherwise forward unchanged. - On unexpected error, route via
Failure.
Output connections
Section titled “Output connections”| Connection | Condition |
|---|---|
Success | Processing completed (including when no keys were deleted). |
Failure | An unexpected error occurred. |
Examples
Section titled “Examples”Example 1 — Delete specific keys from data
Section titled “Example 1 — Delete specific keys from data”{ "deleteFrom": "DATA", "keys": ["internal_id", "deviceName"] }Incoming data: { "temperature": 25.4, "humidity": 62, "internal_id": "xyz-123", "deviceName": "Sensor-A1" }
Outgoing data: { "temperature": 25.4, "humidity": 62 }
Example 2 — Delete keys from metadata
Section titled “Example 2 — Delete keys from metadata”{ "deleteFrom": "METADATA", "keys": ["rssi", "snr"] }Incoming metadata: { "deviceType": "Thermostat", "location": "Floor 1", "rssi": "-56", "snr": "12.1" }
Outgoing metadata: { "deviceType": "Thermostat", "location": "Floor 1" }
Example 3 — Regex pattern deletes multiple keys
Section titled “Example 3 — Regex pattern deletes multiple keys”{ "deleteFrom": "DATA", "keys": ["temp_.*"] }Incoming data: { "temp_main": 33.1, "humidity": 45, "pressure": 1012, "temp_ambient": 21.5 }
Outgoing data: { "humidity": 45, "pressure": 1012 } — both temp_* keys removed.
Example 4 — No matching keys — message passes unchanged
Section titled “Example 4 — No matching keys — message passes unchanged”{ "deleteFrom": "DATA", "keys": ["pressure"] }Incoming data: { "temperature": 22.5, "humidity": 55 } — pressure doesn’t exist.
Outgoing data: unchanged. Routes via Success.
JSON schema
Section titled “JSON schema”{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "TbDeleteKeysNodeConfiguration", "type": "object", "required": ["deleteFrom", "keys"], "additionalProperties": false, "properties": { "deleteFrom": { "type": "string", "enum": ["DATA", "METADATA"], "description": "Where to delete: DATA = message data, METADATA = message metadata." }, "keys": { "type": "array", "items": { "type": "string" }, "description": "Key names or Java regex patterns to delete." } }}