jq
can filter keys with dashes (-
), but that requires special syntax: [\"field-name\"]
Input:
echo '{"the-long-field-name":"true"}' | jq ". | select(.[\"the-long-field-name\"] != null)"
Output:
{
"the-long-field-name": "true"
}
jq
can filter keys with dashes (-
), but that requires special syntax: [\"field-name\"]
Input:
echo '{"the-long-field-name":"true"}' | jq ". | select(.[\"the-long-field-name\"] != null)"
Output:
{
"the-long-field-name": "true"
}