Check_Point
156-521 · Question #155
How do you extract the value of the "ipv4-address" field from a host object response using jq?
The correct answer is C. jq '.["ipv4-address"]'. Since the key contains a hyphen, it must be quoted and bracketed: .["ipv4-address"]. This tells jq to treat the hyphenated key as a literal string, ensuring correct field retrieval.
Check Point API Fundamentals
Question
How do you extract the value of the "ipv4-address" field from a host object response using jq?
Options
- Ajq '.ipv4-address'
- Bjq 'host.ipv4-address'
- Cjq '.["ipv4-address"]'
- Djq '.address'
How the community answered
(43 responses)- A14% (6)
- B5% (2)
- C72% (31)
- D9% (4)
Explanation
Since the key contains a hyphen, it must be quoted and bracketed: .["ipv4-address"]. This tells jq to treat the hyphenated key as a literal string, ensuring correct field retrieval.
Topics
#jq#hyphenated fields#ipv4-address#field extraction
Community Discussion
No community discussion yet for this question.