nerdexam
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)
  • A
    14% (6)
  • B
    5% (2)
  • C
    72% (31)
  • D
    9% (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.

Full 156-521 Practice