nerdexam
Check_Point

156-521 · Question #159

What is the correct jq syntax to retrieve all access rules where action is "Drop"?

The correct answer is A. jq '.rules[] | select(.action == "Drop")'. Using jq '.rules[] | select(.action == "Drop")' filters all rules in the array and prints those whose "action" field is "Drop". It's efficient for analyzing large rulebases.

Security Management API Operations

Question

What is the correct jq syntax to retrieve all access rules where action is "Drop"?

Options

  • Ajq '.rules[] | select(.action == "Drop")'
  • Bjq '.rules[].Drop'
  • Cjq '.rules | Drop == true'
  • Djq '.action[].rules == "Drop"'

How the community answered

(24 responses)
  • A
    54% (13)
  • B
    4% (1)
  • C
    29% (7)
  • D
    13% (3)

Explanation

Using jq '.rules[] | select(.action == "Drop")' filters all rules in the array and prints those whose "action" field is "Drop". It's efficient for analyzing large rulebases.

Topics

#jq#select filter#access rules#rule actions

Community Discussion

No community discussion yet for this question.

Full 156-521 Practice