jsonpath Questions

3

Solved

I'm trying to save the contents of a configmap to a file on my local hard drive. Kubectl supports selecting with JSONPath but I can't find the expression I need to select just the file contents. T...
Tapestry asked 9/8, 2018 at 13:58

5

Solved

I started using Lens and noticed that it gives you some warnings when the pods inside the nodes have limits higher than the actual capacity. So I tried to get this information with kubectl but I'm...
Coze asked 2/2, 2021 at 9:57

2

Solved

I'm using REST-Assured for testing some RESTful webservices. Here's my JSON: { "status":true, "responseData":{ "orderLevelReasons":[ { "reasons":[ { "reasonId":"129cfea8-b022-4dc8-9811-222a...
Ourself asked 12/4, 2017 at 9:4

5

I have AWS step machine and one of the step is used to notify failure using SNS service. I want to select some metadata from input json into outgoing message. So i am trying to concatenate constant...
Factorage asked 18/1, 2019 at 23:31

5

Solved

I'm having difficulty figuring out how to assert with jsonPath in a JSON document response in spring mvc. Perhaps there's a better way of accomplishing this than using jsonPath for this particular ...
Ronn asked 2/9, 2014 at 1:18

4

Solved

I've found jsonpath examples for testing multiple values but not extracting multiple values. I want to get image and name from kubectl get pods. this gets me name kubectl get pods -o=jsonpath='{...
Wallsend asked 14/9, 2017 at 22:23

3

Solved

I need cluster-id using kubectl command. root@vagrant-xenial64:~# kubectl get cm cluster-info -n kube-system -o jsonpath='{.data.cluster-config\.json}' { "cluster_id": "xxx", "cluster_name": "pr...
Swoosh asked 26/6, 2018 at 10:3

4

I'm working with JSON and facing some problems. I want to insert/update a path in a JSON object. In the case that the path doesn't exist, it will be created then I insert a new value. In case that...
Nugent asked 22/8, 2018 at 16:49

7

Solved

Is it possible to count the number of members using JsonPath? Using Spring MVC test I'm testing a controller that generates {"foo": "oof", "bar": "rab"} wit...
Filmore asked 6/12, 2012 at 14:8

7

Solved

I would like to have a default value for a parameter passed into a step function e.g., "Parameters": { "foo.$": "$.foo" OR "bar" if "$.foo" not specified } is there a way to do this natively...
Jasminjasmina asked 26/11, 2019 at 17:7

11

Solved

I have this JSON output from Kubernetes and got it from kubectl get pods -o jsonpath={.items[*]} <json> { "apiVersion": "v1", "items": [ { "apiVersio...
Turbary asked 24/8, 2017 at 2:19

6

Solved

Using the SelectToken method of JSON.NET to select a token with JSONPath, I found no way to specifiy that the search should be case-insensitive. E.g. json.SelectToken("$.maxAppVersion") should ...
Gymnastic asked 29/2, 2016 at 16:20

3

How to list All Containers that are not running using Kubectl command. I want output like CONTAINER_NAME STATUS POD_NAME NAMESPACE <br> container_1 Running pod_1 ns1 <br> container_2 No...
Glary asked 23/12, 2020 at 9:17

2

I am trying to get the departments id where location is USA in the following JSON { "datapoints": [{ "id": "default.1", "definedBy": "default/0.1&quo...
Aubade asked 11/7, 2023 at 0:48

6

Solved

I would like to use kubectl to print out all key-value pairs in my Secrets. I cannot figure out how to do this in one line with the -o --jsonpath flag or by piping into jq. I could certainly make a...
Pointer asked 11/5, 2018 at 6:13

5

Solved

Hey all, I was wondering if any knew of a way to use a regular expression or wildcard operator (or pehaps '%LIKE%' in SQL) so I could use JSONPath to do searching within a large set of JSON data. ...
Scythia asked 5/1, 2010 at 0:4

4

Solved

I have a sample Json response as followed below I know how to filter it using comparison actions like == or > e.g. I can use $.books[?(@.pages > 460)] to retrieve books with more than 460 pag...
Foliated asked 4/1, 2021 at 21:10

5

Solved

I have the following JSON and I need to get the plain name value using JSONPath: { "single" : { "id" : 1, "name" : "Item name" } } Expression that I used is $.single.name but I always get a...
Survey asked 12/5, 2014 at 11:40

3

Solved

echo "apiVersion: v1 kind: Node metadata: name: host-cluster-control-plane-64j47 labels: beta.kubernetes.io/arch: amd64 " | yq -o p Result: apiVersion = v1 kind = Node metadata.name =...
Childbed asked 24/3, 2023 at 21:57

2

Solved

I get the following JSON result from an external system: { "key1": "val1", "key2": "val2", "key3": "val3" } Now I want to display all keys and all values by using JSONPath. So I am looking fo...
Eurystheus asked 28/9, 2017 at 14:20

3

Solved

In an example table: CREATE TABLE example ( id SERIAL PRIMARY KEY, data JSON NOT NULL ); INSERT INTO example (id, data) VALUES (1, '[{"key": "1", "value": "val...
Simba asked 31/5, 2021 at 8:59

2

Solved

Using the following JSON (from http://jsonpath.com): { "firstName": "John", "lastName" : "doe", "age" : 26, "address" : { "streetAddress": "naist street", "city" : "Nara", "postalCode" : "6...
Daryldaryle asked 30/4, 2017 at 14:58

3

So I'm working on the below json: { "id": "", "owner": "some dude", "metaData": { "request": { "ref": null, "contacts":[ { "email": null, "name": null, "contactType": "R" }, { "email"...
Unicameral asked 8/1, 2017 at 4:48

4

Given the below Json input: { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 } I need to select the author field if the author matches a given n...
Chara asked 30/7, 2014 at 7:36

3

Solved

Given json such as {"arr1" : [1,2,3], "arr2" : []} where it is known that there are arrays named arr1 and arr2, is there a jsonpath expression for the length of an array that will work for both...
Reflective asked 16/7, 2014 at 8:24

© 2022 - 2025 — McMap. All rights reserved.