{
  "schema_version": 2,
  "id": "integrate/redis-data-integration/reference/jmespath-custom-functions",
  "title": "JMESPath custom functions",
  "url": "https://redis.io/docs/latest/integrate/redis-data-integration/1.19.1/reference/jmespath-custom-functions/",
  "summary": "JMESPath custom function reference",
  "content": "\nSee also the [JMESPath functions proposal](https://jmespath.org/proposals/functions.html)\nfor a full description of the function syntax and a list of built-in functions.\n\n| Function             | Description                                                                                                                         | Example                                                                                                                                                                                                  | Comments                                                                                                                                                         |\n| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `base64_decode`      | Decodes a base64(RFC 4648) encoded string                                                                                           | Input: `{\"encoded\": \"SGVsbG8gV29ybGQh\"}` \u003cbr /\u003e Expression: `base64_decode(encoded)` \u003cbr /\u003e Output: `Hello World!`                                                                                       |                                                                                                                                                                  |\n| `capitalize`         | Capitalizes all the words in the string                                                                                             | Input: `{\"name\": \"john doe\"}` \u003cbr /\u003e Expression: `capitalize(name)` \u003cbr /\u003e Output: `John Doe`                                                                                                            |                                                                                                                                                                  |\n| `concat`             | Concatenates an array of variables or literals                                                                                      | Input: `{\"fname\": \"john\", \"lname\": \"doe\"}` \u003cbr /\u003e Expression: `concat([fname, ' ' ,lname])` \u003cbr /\u003e Output: `john doe`                                                                                    | This is equivalent to the more verbose built-in expression: `' '.join([fname,lname])`                                                                            |\n| `filter_entries`     | Filters entries in a dictionary (object) using the given JMESPath predicate                                                         | Input: `{ \"name\": \"John\", \"age\": 30, \"country\": \"US\", \"score\": 15}` \u003cbr /\u003e Expression: `` filter_entries(@, `key == 'name' \\|\\| key == 'age'`)``\u003cbr /\u003e Output:`{\"name\": \"John\", \"age\": 30 }`             |                                                                                                                                                                  |\n| `from_entries`       | Converts an array of objects with `key` and `value` properties into a single object                                                 | Input: `[{\"key\": \"name\", \"value\": \"John\"}, {\"key\": \"age\", \"value\": 30}, {\"key\": \"city\", \"value\": null}]` \u003cbr /\u003e Expression: `from_entries(@)` \u003cbr /\u003e Output: `{\"name\": \"John\", \"age\": 30, \"city\": null}` |                                                                                                                                                                  |\n| `hash`               | Calculates a hash using the `hash_name` hash function and returns its hexadecimal representation                                    | Input: `{\"some_str\": \"some_value\"}` \u003cbr /\u003e Expression: `hash(some_str, \u0026#96;sha1\u0026#96;)` \u003cbr /\u003e Output: `8c8181715...`                                                                                    | Supported algorithms: sha1 (default), sha256, md5, sha384, sha3_384, blake2b, sha512, sha3_224, sha224, sha3_256, sha3_512, blake2s                              |\n| `in`                 | Checks if an element matches any value in a list of values                                                                          | Input: `{\"el\": \"b\"}` \u003cbr /\u003e Expression: `in(el, `[\"a\", \"b\", \"c\"]`)` \u003cbr /\u003e Output: `True`                                                                                                                |                                                                                                                                                                  |\n| `left`               | Returns a specified number of characters from the start of a given text string                                                      | Input: `{\"greeting\": \"hello world!\"}` \u003cbr /\u003e Expression: `left(greeting, `5`)` \u003cbr /\u003e Output: `hello`                                                                                                    |                                                                                                                                                                  |\n| `lower`              | Converts all uppercase characters in a string into lowercase characters                                                             | Input: `{\"fname\": \"John\"}` \u003cbr /\u003e Expression: `lower(fname)` \u003cbr /\u003e Output: `john`                                                                                                                       |                                                                                                                                                                  |\n| `mid`                | Returns a specified number of characters from the middle of a given text string                                                     | Input: `{\"greeting\": \"hello world!\"}` \u003cbr /\u003e Expression: `mid(greeting, `4`, `3`)` \u003cbr /\u003e Output: `o w`                                                                                                  |                                                                                                                                                                  |\n| `json_parse`         | Returns parsed object from the given JSON string                                                                                    | Input: `{\"data\": '{\"greeting\": \"hello world!\"}'}` \u003cbr /\u003e Expression: `json_parse(data)` \u003cbr /\u003e Output: `{\"greeting\": \"hello world!\"}`                                                                    |                                                                                                                                                                  |\n| `regex_replace`      | Replaces a string that matches a regular expression                                                                                 | Input: `{\"text\": \"Banana Bannnana\"}` \u003cbr /\u003e Expression: `regex_replace(text, 'Ban\\w+', 'Apple Apple')` \u003cbr /\u003e Output: `Apple Apple`                                                                      |                                                                                                                                                                  |\n| `replace`            | Replaces all the occurrences of a substring with a new one                                                                          | Input: `{\"sentence\": \"one four three four!\"}` \u003cbr /\u003e Expression: `replace(sentence, 'four', 'two')` \u003cbr /\u003e Output: `one two three two!`                                                                  |                                                                                                                                                                  |\n| `right`              | Returns a specified number of characters from the end of a given text string                                                        | Input: `{\"greeting\": \"hello world!\"}` \u003cbr /\u003e Expression: `right(greeting, `6`)` \u003cbr /\u003e Output: `world!`                                                                                                  |                                                                                                                                                                  |\n| `split`              | Splits a string into a list of strings after breaking the given string by the specified delimiter (comma by default)                | Input: `{\"departments\": \"finance,hr,r\u0026d\"}` \u003cbr /\u003e Expression: `split(departments)` \u003cbr /\u003e Output: `['finance', 'hr', 'r\u0026d']`                                                                             | Default delimiter is comma - a different delimiter can be passed to the function as the second argument, for example: `split(departments, ';')`                  |\n| `time_delta_days`    | Returns the number of days between a given `dt` and now (positive) or the number of days that have passed from now (negative)       | Input: `{\"dt\": '2021-10-06T18:56:16.701670+00:00'}` \u003cbr /\u003e Expression: `time_delta_days(dt)` \u003cbr /\u003e Output: `365`                                                                                        | If `dt` is a string, ISO datetime (2011-11-04T00:05:23+04:00, for example) is assumed. If `dt` is a number, Unix timestamp (1320365123, for example) is assumed. |\n| `time_delta_seconds` | Returns the number of seconds between a given `dt` and now (positive) or the number of seconds that have passed from now (negative) | Input: `{\"dt\": '2021-10-06T18:56:16.701670+00:00'}` \u003cbr /\u003e Expression: `time_delta_days(dt)` \u003cbr /\u003e Output: `31557600`                                                                                   | If `dt` is a string, ISO datetime (2011-11-04T00:05:23+04:00, for example) is assumed. If `dt` is a number, Unix timestamp (1320365123, for example) is assumed. |\n| `to_entries`         | Converts a given object into an array of objects with `key` and `value` properties                                                  | Input: `{\"name\": \"John\", \"age\": 30, \"city\": null}` \u003cbr /\u003e Expression: `to_entries(@)` \u003cbr /\u003e Output: `[{\"key\": \"name\", \"value\": \"John\"}, {\"key\": \"age\", \"value\": 30}, {\"key\": \"city\", \"value\": null}]`   |                                                                                                                                                                  |\n| `upper`              | Converts all lowercase characters in a string into uppercase characters                                                             | Input: `{\"fname\": \"john\"}` \u003cbr /\u003e Expression: `upper(fname)` \u003cbr /\u003e Output: `JOHN`                                                                                                                       |                                                                                                                                                                  |\n| `uuid`               | Generates a random UUID4 and returns it as a string in standard format                                                              | Input: None \u003cbr /\u003e Expression: `uuid()` \u003cbr /\u003e Output: `3264b35c-ff5d-44a8-8bc7-9be409dac2b7`                                                                                                            |                                                                                                                                                                  |\n| `xml_to_dict`        | Converts an XML string to a dictionary                                                                                              | Input: `{\"xml\": \"\u003croot\u003e\u003cname\u003eJohn\u003c/name\u003e\u003cage\u003e30\u003c/age\u003e\u003c/root\u003e\"}` \u003cbr /\u003e Expression: `xml_to_dict(xml)` \u003cbr /\u003e Output: `{\"root\": {\"name\": \"John\", \"age\": \"30\"}}`                                           | Returns `null` if the input is `null`; returns an empty string if the input is an empty string                                                                   |\n",
  "tags": ["docs","integrate","rs","rdi"],
  "last_updated": "2026-09-19T17:55:58-07:00"
}
