Pls help with this jolt transformation.
Note:
If there is field
"ServiceFamily"
then change the field name to"tag1"
If there is field
"PublisherName"
then change the field name to"tag2"
Input:
[
{
"ServiceFamily": "Compute",
"CostAllocationRuleName": null,
"benefitId": null,
"benefitName": null
},
{
"PublisherName": "Microsoft",
"ChargeType": "Usage",
"Frequency": "UsageBased",
"PricingModel": "OnDemand",
"benefitName": null
}
]
Expected output:
[
{
"Tag1": "Compute",
"CostAllocationRuleName": null,
"benefitId": null,
"benefitName": null
},
{
"Tag2": "Microsoft",
"ChargeType": "Usage",
"Frequency": "UsageBased",
"PricingModel": "OnDemand",
"benefitName": null
}
]