I want to convert JSON string into an array in bash. The JSON string is passed to the bash script as an argument (it doesn't exist in a file). Is there a way o
Assuming I have the following JSON object (which is just an example): { "foo": 1, "bar": 2, "baz": 3 } And the following JSON array (another example)
I return a few json values from an API feed using this command: curl -s -u user:pass -H 'my header' https://example.com/data.json | jq -cr '.[] | {id: .id, con
I have json data that looks like [ { "session": "ffe887f3f150", "src_ip": "81.71.87.156" }, { "session": "fff42102e329", "src_ip": "143.19
I can create a json object with an array using jq like this echo '{"input":{"names":[]}}' | jq --arg val "alice" '.input.names[0] += $val'| jq --arg val "bob"
I have a json file I am parsing with jq. This is a sample of the file [{ "key1":{...}, "key2":{...} }] [{ "key1":{...}, "key2":{...} }] ... each line is a list
How to construct a name of a variable from data and access that variable? For example it should somehow give the content of the alpha-file: jq '$.var"-file"' --
I read data from a json file with jq. I wanna append the results into a yaml file, but I dont get it working. I am quite new to shell programming. My goal is to
I am running a curl rest-api call and try to extra some key/value pairs in UBUNTU. This is my current command: curl ..... | jq -c '{"online": .switches.option
I need to know the most efficient way of installing JQ on Mac (El Capitan). The code is downloaded to my Mac but I would like to know how I can install and oper
I have a json file that needs to be updated on a certain condition. Sample json { "Actions" : [ { "value" : "1", "properties" : {
If I have a JSON like this, { "hello1": "world1", "testk": "testv" } And I want to export each of these key-value pairs as environment variables, how t
If I have a JSON like this, { "hello1": "world1", "testk": "testv" } And I want to export each of these key-value pairs as environment variables, how t
I have this JSON: {"item":2, "url":"domain/house/23/bedroom"} I'm trying to use jq to obtain this new JSON: {"item":2, "number":"23", "room":"bedroom"} Is it
Here Edit yaml objects in array with yq. Speed up Terminalizer's terminal cast (record) I asked about how to edit yaml with yq. I received the best answer. But
How can I extract all key names, even in nested objects with jq? For example, I have json: { "a": 1, "b": { "c": 2 } } and I want to get list:
I am trying to write a shell script that can read a json string, decode it to an array and foreach through the array and use the key/value for replacing strings
I have a JSON file as an export of a nosql database, the sample below is 2 of 1xxx records. { "task": { "id1": { "completed": true,
I have a very large json file I would like to stream (using --stream) and filter with jq, then save it as a csv. This is the sample data with two objects: [{"_i
I am trying to merge all json files in a directory (can be many). I know that if there are only 2 files, I can use jq -s . file1.json file2.json. But when I tri