jmespath Questions
1
Is it possible to write JMESPath expression to return a list of object names where a specific subproperty value is set? In the example below I'd like to get a list of all hostsnames where fileexist...
Henshaw asked 9/5, 2018 at 9:6
0
I am trying to use the Python Library for JMESPath to extract information from a large JSON file, a much simplified example is here:
{
"high_name":"test",
"sections"...
Cadre asked 25/2, 2019 at 12:16
1
Solved
I have a dictionary, I want to do a nested jmespath.search on the keys of the dictionary for keys that start with a specific string, but I can only seem to use the @ operator once.
> d = {'foo1...
Auriol asked 29/1, 2019 at 23:59
2
Solved
I would like to use the AWS CLI to query the contents of a bucket and see if a particular file exists, but the bucket contains thousands of files. How can I filter the results to only show key name...
Explore asked 3/12, 2014 at 15:4
1
Solved
I'm trying to filter a plain list I get from the Azure CLI, and am struggling to construct a query that filters the list properly. An example which encapsulates what I'm trying to accomplish would ...
Wimple asked 17/1, 2019 at 17:30
3
Solved
Using aws-cli 1.3.6 I am trying to get a simple table of my ec2 instances with the Name and state. I have been looking at the --query and JMESpath documentation and I have been able to select the "...
Pyroligneous asked 5/4, 2014 at 19:15
2
Solved
I have list of dicts that contains another list in one of fields. I want to "flatten" that list, so it gives me every subelement with one field (or some fields) from parent copied into it. Example:...
Artima asked 6/10, 2018 at 20:19
3
Solved
I have a dictionary of packages with package-name being the key and a dictionary of some details being the value:
{
"php7.1-readline": {
"latest": "7.1.9-1+ubuntu14.04.1+deb.sury.org+1",
"orig...
Lloyd asked 19/9, 2017 at 17:20
2
I have a JSON object with two arrays — one keys array and one values array, both of the same length. Using jmespath, I want to construct a new object using the values of the keys array as the keys ...
Dualistic asked 9/8, 2015 at 3:23
1
Solved
JMESPath is a query language for JSON, used by Azure.
Using its own example given from http://jmespath.org/
{
"locations": [
{"name": "Seattle", "state": "WA"},
{"name": "New York", "state":...
2
Solved
In the example JSON at the bottom of this question, how can I count the number of key/value pairs in the array "Tags" using JMESPath?
According to the JMESPath documentation, I can do this using t...
1
Solved
I have a JSON
{
"key": "processId-29231",
"fields": {
"attachment": [
{
"id": "79572",
"filename": "File1.png"
},
{
"id": "74620",
"filename": "File2.docx"
},
{
"id": "79072",
"filena...
Waistline asked 30/5, 2018 at 1:3
2
Solved
With a json output like :
{
"Functions":[
{
"CodeSha256":"7NBvXXacp9x3aK3cKaI=",
"FunctionName":"function_1",
"FunctionArn":"arn:aws:lambda:eu-west-1:1111:function:function_1",
"LastModified...
Cima asked 23/2, 2017 at 11:13
1
Solved
I'm trying to filter by multiple values however I can't seem to get an and clause to work (e.g. filter1 and filter 2 ... etc.):
Show me snapshots where the database name is 'testing'
aws rds de...
2
Solved
I have the following JMESPath query
query="Reservations[].Instances[].{ \
InstanceId: InstanceId, \
RootDeviceVolumeId: BlockDeviceMappings[?DeviceName==\`/dev/sda1\`] \
| [].Ebs.VolumeId | [0...
Homogenize asked 23/2, 2015 at 12:23
1
Solved
My Google search skills are failing me. How to get a list of all JSON object keys in JMESPath?
i.e. how to go from:
{"a": 1, "b": 2}
to:
["a", "b"]
1
Solved
I write this:
- name: test for seed
debug:
var: hostvars|json_query("*.ansible_host")
And it prints every host. But this does not filter hosts:
- name: test for seed
debug:
var: hostvars|js...
2
I'm trying to output multiple tags from an ec2 instances description. The tag values that I want are Name and aws:autoscaling:groupName.
"Tags": [
{
"Value": "somename",
"Key": "Name"
},
{...
Defection asked 11/4, 2017 at 18:57
1
Solved
The following JmesPath expression finds instances that have been tagged with a team:
"Instances[?Tags[?Key=='team']]"
Do you know how to find instances that are not tagged with a team?
I have t...
Ericaericaceous asked 22/2, 2017 at 16:23
1
Solved
Using JMESPath, is it possible to filter output based on the existence of multiple key/value pairs within the input?
From the example JSON below, what I'd like to do is extract only the objects th...
Gavette asked 6/1, 2017 at 10:13
1
Solved
Does anyone know what json-query filter can be used to select Tigger's food in the sample JSON below? The JSON is a simplified stand-in for a massive and relatively complicated AWS blob.
Some back...
Rad asked 21/12, 2016 at 11:24
© 2022 - 2024 — McMap. All rights reserved.