Questions tagged [jmespath]

JMESPath (JSON Matching Expression paths) is a query language for JSON. JMESPath allows you to extract elements from a JSON document. It also allows you to directly transform the queried elements.

JMESPath (JSON Matching Expression Paths) is a query language for .

In addition to allowing you to extract elements from a JSON document, it also allows you to transform the queried elements.

In other words: JMESPath is to JSON what is to .

For questions about JSON itself, please use the tag.

Useful Links:

495 questions
0
votes
1 answer

Remove null values using JMESPath

[ { "key": 111, "Students_Info": [{ "recordId": 111 }], "Adress_Info": { "position": 1, "city": null } }, { "key": 222, "Students_Info": [{ "recordId": 222 }], "Adress_Info": { …
coder
  • 13,002
  • 31
  • 112
  • 214
0
votes
0 answers

Azure CLI filtering with JMESPath for child property that is set to null

I'm using the Azure CLI to query Azure DevOps pull requests. E.g.: az repos pr list --status completed This returns data similar to: [ { "artifactId": null, "autoCompleteSetBy": null, "closedBy": null, "closedDate":…
David Gardiner
  • 16,892
  • 20
  • 80
  • 117
0
votes
1 answer

Unable to access "Tag" attribute value for 'describe-auto-scaling-groups' using AWS CLI JMESPath query command

Purpose - To fetch list of values for "Tags" where 'Key==Project'. Query - For describe-auto-scaling-groups - Trying to access the Tag attributes with 5 array items Tag[5] with each array having 5 fields (eg- resourceid:foo…
0
votes
0 answers

Flatten list in dictionaries using JMESPath?

I have a json that looks like the following (greatly simplified): [ { "kind": "vehicles", "examples": ["car", "helicopter"] }, { "kind": "stars", "examples": ["blue", "red", "neutron"] } ] I'd like…
a693673
  • 57
  • 1
  • 1
  • 5
0
votes
1 answer

JSMEPath query for nested array not working

I have the following JSON structure as a result of an Azure CLI call: az network application-gateway show-backend-health ` --resource-group $resourceGroup ` --name $appGatewayName ` JSON: { "backendAddressPools": [ { …
Wouter de Kort
  • 39,090
  • 12
  • 84
  • 103
0
votes
0 answers

JMESPath query on Azure cloud storage returning blank

I can explore on Azure explorer and see the blob exists but when I run the query, it is returning blank. Can anyone help with the issue? It just keeps on running when I remove the limit on number of Results. numResults=4000 az storage blob list \ …
0
votes
0 answers

JMESPath, is it possible to convert a JSON array of objects to a JSON object map with specific keys?

currently trying to filter a JSON object and preserve the original schema using JMESPath but am having some trouble. Within my file exists an object like so: { "names": { "1": { "id": "1", "name": "a" }, "2": { "id":…
tsvng
  • 1
0
votes
0 answers

Remove the duplicate id based on status without pandas?

I need to write a output from aws account to excel sheet. I am using graphql and using jmespath.search to map the expressions and store in a excel sheet. I am facing issue with duplicate Id getting stored. I am using filter to merge two columns…
akdgp
  • 11
  • 2
0
votes
0 answers

Dynamic path in JMESPath

Trying to access some data by key, where key itself stored in some field { "keyName": "bbb", "storage": { "aaa": "111", "bbb": "222", "ccc": "333" } } In JavaScript (and most other languages) it will be…
Gheljenor
  • 362
  • 3
  • 3
0
votes
1 answer

How to find all the instances that were not successful in a "Systems Manager" run command?

I ran the AWS-RunPatchBaseline run command and few of my instance are successful and few of them are timed out. I want to filter the instance that were timed out using the aws cli list-command-inovcations command. When I ran the below CLI…
0
votes
2 answers

Ansible to parse multiple fields and count the results for each unique combination

long time listener / first time caller. In ansible, I’m using the json_query in jmespath and am unable to figure out how to make it do what i want exactly. If I have a blob of data like this about a collection of hosts stored in memory from an…
KDP
  • 1
  • 2
0
votes
2 answers

Using Azure CLI Get the 'principalId' value of an Azure Application Gateway

PS /home/ian> az network application-gateway identity show --gateway-name "xxx-inf-abc-wag" --resource-group "network-xxx" { "principalId": null, "tenantId": null, "type": "userAssigned", "userAssignedIdentities": { …
Ian Carrick
  • 242
  • 3
  • 18
0
votes
1 answer

JMESPath in ansible playbook

I have the below json where i want to extract each subset of rules based on the name (example: (SUP) Filesystem usage /var >85%) in my ansible playbook so i can use it as input for my following task. {"nprd_infrastructure_disk_rules": [ [ …
Kevin
  • 143
  • 1
  • 8
0
votes
1 answer

aws git-remote-codecommit operation error (GRC)

I hit this error when using git with a remote codecommit repo using GRC protocol. git fetch Traceback (most recent call last): File "/home/meh/.local/bin/git-remote-codecommit", line 6, in from pkg_resources import load_entry_point …
0
votes
0 answers

JMESPath Remove Time from Date

I am using JMESPath to query REST Api from a Fortigate Firewall. My query is here: Licensing.forticare.support.hardware.[expires_r] Results: [ "2025-12-04T00:00:00.000Z" ] How do I remove the T and everything after it so I am only left with a…