Get sub-objects in JSON where key values unknown
I have the following JSON generated from a command. The JSON is composed of objects where the key is a random string, and I want to access data in each of those objects. Any thoughts on how to do that, without knowing the value of the key for each object?
How to Subtract Objects in jq?
We can merge two objects recursively with *
operator. For example like this: jq '.[0] * .[1]' -s a.json b.json
. The only problem (I realized) with it is it doesn’t merge the arrays. But some guys did it.
How to Subtract Objects in jq?
We can merge two objects recursively with *
operator. For example like this: jq '.[0] * .[1]' -s a.json b.json
. The only problem (I realized) with it is it doesn’t merge the arrays. But some guys did it.
jq query with multiple conditions not working
I’m trying to run a jq query with multiple conditions, where the fields in the condition are in different parts of the JSON. The second condition isn’t narrowing things down, and I need help figuring out why. The JSON is below.
jq query with multiple conditions not working
I’m trying to run a jq query with multiple conditions, where the fields in the condition are in different parts of the JSON. The second condition isn’t narrowing things down, and I need help figuring out why. The JSON is below.
jq query with multiple conditions not working
I’m trying to run a jq query with multiple conditions, where the fields in the condition are in different parts of the JSON. The second condition isn’t narrowing things down, and I need help figuring out why. The JSON is below.
Print data for an object based on value(variable) for a key in jq output [duplicate]
This question already has answers here: Filter by Regex in JQ (2 answers) How to add contains or startswith in jq (1 answer) Closed last month. I have this JSON : [ { “id”: “1”, “agent”: “23ef”, “displayName”: “foo.com” }, { “id”: “2”, “agent”: “23gh”, “displayName”: “foo2.com” }, { “id”: “3”, “agent”: “23gf”, “displayName”: “boo.com” […]
Delete all where DOES NOT contain
I have this JSON file json1.json:
How to assign field name in jq based on a try catch?
I have a json like this:
How to assign field name in jq based on a try catch?
I have a json like this: