Ubuntu 16.04
bash -version
GNU bash, version 4.4.0(1)-release (x86_64-unknown-linux-gnu)
I would like to grep
for 2 patterns and then have them listed side by side. At the moment, this is what I have:
root@tires ~ # grep -e tire_id -e appID /path/to/*/vehicle/production.json
/path/to/000001_000002/vehicle/production.json: "tire_id": "1305436516186552",
/path/to/000001_000002/vehicle/production.json: "appID": "1164562920689523",
/path/to/000001_000079/vehicle/production.json: "tire_id": "1815123428733289",
/path/to/000001_000079/vehicle/production.json: "appID": "18412365908966538",
/path/to/000001_000088/vehicle/production.json: "tire_id": "138477888324",
This is what I would like to have although anything similar would work actually.
root@tires ~ # grep -e tire_id -e appID /path/to/*/vehicle/production.json
/path/to/000001_000002/vehicle/production.json: tire_id: 1305436516186552, appID: 1164562920689523
/path/to/000001_000079/vehicle/production.json: tire_id: 1815123428733289, appID: 18412365908966538
File example here:
{
"socal": "https://xxx.xxxxx.xxx",
"ip": "xxx.xxx.xxx.xxx",
"tire_id": "213275925375485",
"client": {
"platform": "xx",
"clientID": "xxxxx",
"serviceID": "xxxxx",
"service_id": XXXX,
"vendor": "default"
},
"locale": "en_US",
"cdc": {
"appID": "233262274090443",
"isdel": "ORdiZBMAQS2ZBCnTwZDZD",
},
"attachments": {
"output": "attachments",
"public": false,
},
}
jq
thangrep
.production.json
contents