get_jmespath

get_jmespath(value: storable, query: const string) -> variant

Process an object or array expression using a query written in the JMESPath query language.
This function provides advanced functionality to extract, filter, and manipulate object
or array data. Below we provide a few basic examples of how to use the JMESPath query language.
See the JMESPath Tutorial in the JMESPath documentation
for more information.

Note: for use cases that do not require the advanced features of JMESPath, see
get_field and get_item.

Domain

This is a scalar function (calculates a single output value for a single input row).

Categories

Examples

Flatten an array of objects by selecting the specific key "value" out of the
objects, creating a new array for the results. For example, given input
[{"key":"a", "value":"b"}, {"key":"c", "value":"d"}], this get_jmespath()
expression returns ["b", "d"].

Filter an array of objects and return the name of the objects whose field
state has value "running". For example, the following input returns ["app2", "app3"]:

[
    {
        "name": "app1",
        "state": "idle"
    },
    {
        "name": "app2",
        "state": "running"
    },
    {
        "name": "app3",
        "state": "running"
    }
]