Update
If you're not sure about the number of objectUse jq's add, you can usethis will concatenate all the add option;input objects;
// Multiple variables holding objects jq -s add <<< "$j1 $j2 $j3" //or command |Multiple files holding objects jq -s add file1 file2 file3 3 Files
If your existing json is available from 3 seperate files, you can use the following jq command to concatenate them;
jq // -sCommand '.[0]output *with .[1]multiple *columns command .[2]'| file1jq file2-s file3add 3 VariablesManually
If the separate json is available in 3 variables, create a new string, containing those 3 objects. Use here string to pass the string into jq:You can add multiple columns by hand like so;
jq -s '.[0] * .[1] * .[2]' <<< "$j1file1 $j2file2 $j3"file3 Result
Both options result in:
{ "Woonkamer": { "currentTemperature": 21.8, "battery": 75, "isFailed": false }, "Hal": { "currentTemperature": 19.5, "battery": 48, "isFailed": false }, "Bijkeuken": { "currentTemperature": 18.4, "battery": 56, "isFailed": false } }