I have two file json. I want to append two array of SomeFile2.json to SomeFile1.json as below.
SomeFile1.json
[ { "DNSName": "CLB-test-112a877451.ap-northeast-1.elb.amazonaws.com", "Instances": [ { "InstanceId": "i-0886ed703de64028a" } ] }, { "DNSName": "CLB-test1-156925981.ap-northeast-1.elb.amazonaws.com", "Instances": [ { "InstanceId": "i-0561634c4g3b4fa25" } ] } ] SomeFile2.json
[ { "InstanceId": "i-0886ed703de64028a", "State": "InService" }, { "InstanceId": "i-0561634c4g3b4fa25", "State": "InService" } ] I want the result as below:
[ { "DNSName": "CLB-test-112a877451.ap-northeast-1.elb.amazonaws.com", "Instances": [ { "InstanceId": "i-0886ed703de64028a" "State": "InService" } ] }, { "DNSName": "CLB-test1-156925981.ap-northeast-1.elb.amazonaws.com", "Instances": [ { "InstanceId": "i-0561634c4g3b4fa25" "State": "InService" } ] } ] I'm processing in bash shell via jq. But, unsuccessful.