# json_extract_path

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [cloud-data-platform-full.txt](https://docs.redpanda.com/cloud-data-platform-full.txt)

---
title: json_extract_path
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-connect-version: 4.93.0
latest-redpanda-tag: v26.1.9
docname: sql/sql-functions/json-functions/json-extract-path
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: sql/sql-functions/json-functions/json-extract-path.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path.adoc
description: "`json_extract_path()` function extracts JSON nested value from a specified path."
page-topic-type: reference
page-git-created-date: "2026-05-26"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-functions/json-functions/json-extract-path.md -->

`json_extract_path()` function extracts `json` nested value from a specified path.

## [](#syntax)Syntax

The syntax of the `json_extract_path()` function is:

```sql
JSON_EXTRACT_PATH(from_json JSON, path TEXT[])
```

-   `from_json`: The `json` value from which to extract.

-   `path`: The path to extract.


### [](#another-option)Another option

Redpanda SQL also provides and supports the use of operators in queries:

```sql
SELECT 'from_json'::JSON -> 'path';
```

-   `from_json`: The `json` value from which to extract.

-   `::JSON`: A symbol that casts the text literal to a `json` type.

-   `path`: Key of the field to extract.


## [](#examples)Examples

These examples display how `json_extract_path()` extracts the “oxla” `json` sub-object from the specified path.

1.  Use the query:

    ```sql
    SELECT JSON_EXTRACT_PATH('{"f2":{"f3":1},"f4":{"f5":99,"f6":"oxla"}}', 'f4', 'f6');
    ```

    **or**

    ```sql
    SELECT '{"f2":{"f3":1},"f4":{"f5":99,"f6":"oxla"}}'::JSON -> 'f4' -> 'f6';
    ```

    The query results:

    ```sql
    +---------+
    | f       |
    +---------+
    | "oxla"  |
    +---------+
    ```

2.  Run the query:

    ```sql
    SELECT
        JSON_EXTRACT_PATH('{"a": 1, "b": {"x": "subtract", "y": "plus"}}', 'b', 'x') AS "bx",
        JSON_EXTRACT_PATH('{"a": 1, "b": {"x": "multiply", "y": "divide"}}', 'b', 'y') AS "by";
    ```

    The query returns:

    ```sql
    +---------------+-------------+
    | bx            | by          |
    +---------------+-------------+
    | "subtract"    | "divide"    |
    +---------------+-------------+
    ```