jmespath Questions

2

Solved

I am trying to create an az cli query that can evaluate if I am logged into the correct tenant and subscription. I know I have to use the ? and && operators but have not been able to get th...
Hydromechanics asked 15/4, 2020 at 20:17

4

Solved

I have JSON containing an array of databases, each database has an array of users, e.g. {"databases": [ {"db": "db_a", "users": [{"name": "al...
Demodulation asked 12/1, 2019 at 14:10

2

Solved

I have a json block that looks a bit like this (have you guessed from AWS) { "Vpcs":[ { "VpcId":"vpc-blabla1", "OtherKey":"Value" }, { "VpcId":"vpc-blabla2", "OtherKey":"Value" }, { "Vp...
Ourself asked 21/6, 2016 at 13:6

3

Solved

Messing around with a simple aws cli query to check for the existence of a Lambda function and echo the associated role if it exists: #!/bin/bash fname=$1 role=$(aws lambda list-functions --query...
Nunnery asked 14/10, 2015 at 16:54

3

Solved

In an aws cli jmespath query, with for example the output ["a","a","b","a","b"], how do i extract the unique values of it to get ["a","b"]?
Publicspirited asked 4/5, 2016 at 8:48

1

The question is simple. How to do a case-insensitive searching with JMESPath? Let's say to search for foo in this JSON: [ "foo", "foobar", "barfoo", "bar&quot...
Syncytium asked 15/9, 2021 at 1:54

1

Solved

In the new AWS console I can do inverse search, i.e.: search that does not match a certain value, with a filter. I am trying to achieve the same using the AWS cli v2. It's straight forward to filte...
Chryso asked 15/7, 2022 at 17:51

3

I have an object that I am parsing using JMESPath where the value of a property is a JSON object encoded as a string. I want to be able to parse that string property as a JSON Object and work with ...
Ptisan asked 14/4, 2018 at 4:9

2

Solved

I have an example json file. I need to extract all the values of the downloadUrl keys: { "nodes": { "children": [ { "id": "", "localizedName":...
Torp asked 4/3, 2022 at 0:22

4

Solved

I'm trying to filter properties of an object in jmespath based on the value of a subproperty and want to include only those properties where the subproperty is set to a specific value. Based on th...
Size asked 10/1, 2017 at 22:30

11

Solved

Is there a way to define a XPath type query for nested python dictionaries. Something like this: foo = { 'spam':'eggs', 'morefoo': { 'bar':'soap', 'morebar': {'bacon' : 'foobar'} } } print...
Fleawort asked 6/9, 2011 at 13:1

3

I want to filter the output from the Azure CloudShell command az ad sp list which outputs a JSON array, eg by filtering to Publisher Name = "ACME". All az commands support a --query argument which ...
Lilalilac asked 22/3, 2019 at 15:42

1

Solved

Below is a sample JSON: { "School": [ {"@id": "ABC_1", "SchoolType": {"@tc": "10023204", "#text": "BLUE FOX"}}, ...
Plebs asked 20/10, 2021 at 17:50

3

I would like to know if there is substring function one can leverage in JMESPATH (supported by az cli). I have the below az cli request and I want to just extract the name of the linked subnet wit...
Breazeale asked 4/12, 2020 at 17:32

1

{ "data": { "edges": [ { "node": { "id": "ABC12345", "tags": [ { "name": "Dummy" }, { "name": &q...
Satiable asked 30/10, 2020 at 3:2

1

I need to work with some systems that use JMESPath to search JSON. How can I search for strings with pattern (like this). How do I do this with a regular expression in case-insensitive mode? ...
Debenture asked 18/6, 2021 at 18:29

2

Solved

I want to use the CLI tool, to retrieve the distribution-id of a CloudFront distribution with a specific cname/alias. This is what I came up with: aws cloudfront list-distributions --query "Distr...
Partitive asked 23/2, 2016 at 9:34

1

How can I search for an array in a json using a regex in jmespath? Consider the following JSON document (set aside if it's poorly constructed): { "people_in_town": [ {"letter"...
Metallophone asked 17/3, 2021 at 16:44

2

Solved

I want to get a list of addresses of a defined interface type. I found some info here. Here is my playbook: - name: Test JMESPath hosts: localhost gather_facts: no vars: interfaces: - name: e...
Desilva asked 1/12, 2020 at 16:57

1

Solved

I am using the following to find information about instances associated with a particular Security Group aws ec2 describe-network-interfaces --filters Name=group-id,Values=sg-123456 --output json ...

1

Solved

There's an example of search in the tutorial going: { "machines": [ {"name": "a", "state": "running"}, {"name": "b", "s...
Locoweed asked 10/10, 2020 at 12:2

2

Solved

Is it possible to move the preg_match search below into the JMESPATH search filter using contains? I found an example of contains in the JMESPATH tutorial, but I'm not sure if the syntax supports c...
Uncomfortable asked 1/9, 2020 at 13:52

4

Solved

I saw the previous question on this topic, but the answer was just "pipe it to a scripting language!", which I find unsatisfying. I know that JMESPath has sort_by, and sort, but I can't figure out ...
Grill asked 8/6, 2018 at 0:46

1

Solved

I have a JSON object in which I wish to retrieve the value of a property that contains a dot in its name using JMESPath: { "a": { "b.c": "value" } } In this example I wish to retrieve value. ...
Anadromous asked 3/7, 2019 at 14:47

2

Solved

I am trying to filter results that arrived from boto3 in Ansible. When I use json query on the results without the "[?starts_with(...)]" it works well, but when adding the starts_with syntax: "st...
Untaught asked 14/6, 2017 at 13:24

© 2022 - 2024 — McMap. All rights reserved.