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

AWS CLI How to check if images follows a special pattern tag value

I'm trying to filter the images that follow the following pattern in their tag value: dev/yyyy-mm-dd eg. : dev/2021-09-11 the best idea that came up to me was something like this: aws ec2 describe-images --filters…
Good Panic
  • 117
  • 1
  • 1
  • 6
0
votes
1 answer

JMESPath starts_with function fails using Azure Cli

In Microsoft Lab 09 > Exercise 4 > Task 1 > 2 it is instructed to list resource groups running the following command az group list --query "[?starts_with(name,'az400m10l01-RG')].name" --output tsv If I do run it, I get the following error ].name…
eliassal
  • 343
  • 5
  • 20
0
votes
1 answer

AzureCLI get expired Vault Secrets

Is there a way to list all expired secrets from an Azure Key Vault using the CLI? So far I have az keyvault secret list --vault-name --output table --query [*].'{"Id":id,"expires":attributes.expires}' This shows me a list | Id | expires…
Adrian
  • 670
  • 10
  • 24
0
votes
0 answers

azure cli list in resource group the vm resources used

How to use azure cli to list the vms of a specific subscription/resource group of their resources used, like size of the VM, and type of OS, etc? Like in How to get a list of available vm sizes in an azure location, it can only list by azure…
xpt
  • 20,363
  • 37
  • 127
  • 216
0
votes
1 answer

JSONPath | JMeter | Condition fetch

Using JSONPath I'm trying to fetch channels > "id": "6af38171-867c-414f-a128-6668fc66cd20" based on provided productId from different request Example 1: for "productId": "3211a29f0c3-9180-4cd7-a5c7-282f6689c31a", channel id should be "id":…
FeelGood
  • 11
  • 3
0
votes
0 answers

Runtime.ImportModuleError - Error: Cannot find module 'jmespath'

How can I fix the below error? const AWS = require('aws-sdk'); var jmespath = require('jmespath'); ------------------- "errorType": "Runtime.ImportModuleError", "errorMessage": "Error: Cannot find module 'jmespath'\nRequire stack:\n-…
Devi
  • 73
  • 1
  • 7
0
votes
1 answer

How to get data from two nodes with JMESPath

I get search results as JSON and try to match specific data with JMESPath . what succeed only in part. JSON looks like this: { "search_parameters": { "location": "Berlin,Berlin,Germany", "q": "mykeyword" }, "organic_results": [ …
Evgeniy
  • 2,337
  • 2
  • 28
  • 68
0
votes
1 answer

Jmespath Map function

I have this Json example: { "client_id": 15, "orders": [ { "order": 110, "status": "APPROVED", }, { "order": 141, "status": "REJECTED", } ] } I want to generate the result [ …
0
votes
1 answer

azure cli - JMESPath querying using python

So I'm building a quite simple script which I originally built on bash but I want to reuse it on multiple platforms so I decided to do it in python. I did get it working in bash and I got the querying using JMESPath working but Python seems to…
Vlatko
  • 13
  • 7
0
votes
1 answer

unable to ideally parse a json file in ansible

Below is my sample JSON file. [ { "?xml": { "attributes": { "encoding": "UTF-8", "version": "1.0" } } }, { "domain": [ { "server": [ { …
Ashar
  • 2,942
  • 10
  • 58
  • 122
0
votes
1 answer

Bash script for azure cli query, output not quite what I want

I have a script that I want to use for Azure to return the resource group, storage account name, storage container name, name of the blob object, size of the blob object, and storage tier. I have the…
Pete
  • 21
  • 6
0
votes
1 answer

JMESPath propagating outer field to dicts in list

I'm trying to write JMESPath for following structure: { "example": [ { "field": "value", "lst": [ { "inner_field": "fvalue" } ], } …
Azzten
  • 13
  • 3
0
votes
1 answer

Ansible sort output by numbers

Im using Ansible 2.9 and i want to order msg devices by number, i have this msg : msg: "{{ facts['ansible_facts'] | to_json | from_json | json_query('ansible_net_interfaces[?starts_with(name,`pl2`)].name') | list| sort }}" And i have this…
gsr
  • 169
  • 2
  • 19
0
votes
1 answer

JMESPath to combine nested array with nested key value

The input JSON is: $ cat multiple.json [ { "postfix": [ "aaa", "bbb", "ccc" ], "prefix": "one-" }, { "postfix": [ "aaa", "bbb", "ccc" ], "prefix": "two-" } ] The output…
aberends
  • 53
  • 2
0
votes
1 answer

Exclude Properties in Azure CLI Output's JSON

I'm trying to exclude a few properties from Azure's CLI Output. I know I can use --query to filter through the output using its JMESPath. But I want to exclude just one of them, so it doesn't make sense to select all the other using --query. Is…
QuantAC
  • 31
  • 1
  • 9