nerdexam
Check_Point

156-521 · Question #151

Which jq expression retrieves the UID from the following JSON object: {"uid": "abc123", "name": "host1"}?

The correct answer is A. jq '.uid'. To extract a field from a JSON object using jq, you prefix the key with a dot. So .uid retrieves the value of the "uid" field, which in this case returns "abc123".

Check Point API Fundamentals

Question

Which jq expression retrieves the UID from the following JSON object: {"uid": "abc123", "name":

"host1"}?

Options

  • Ajq '.uid'
  • Bjq '.name'
  • Cjq 'uid'
  • Djq 'get.uid'

How the community answered

(25 responses)
  • A
    92% (23)
  • B
    4% (1)
  • C
    4% (1)

Explanation

To extract a field from a JSON object using jq, you prefix the key with a dot. So .uid retrieves the value of the "uid" field, which in this case returns "abc123".

Topics

#jq#UID extraction#JSON query#field access

Community Discussion

No community discussion yet for this question.

Full 156-521 Practice