jq ignore missing attribute by Ciro Santilli 34 Updated +Created
echo '[{"a": 1, "b": 2}, {"b": 3}]' | jq '.[] | select(.a) | .a'
Output:
1
and no empty lines as desired.