CAS-005 · Question #72
A security administrator needs to automate alerting. The server generates structured log files that need to be parsed to determine whether an alarm has been triggered. Given the following code…
The correct answer is D. <"error_log": {"system_1": {"InAlarmState": True }}}. Based on the provided Python code snippet, the answer <"error_log": {"system_1": {"InAlarmState": True }} is a minimal example of the JSON data structure that would cause the code's if condition to evaluate as True. The code checks for the presence and value of a nested key: if…
Question
A security administrator needs to automate alerting. The server generates structured log files that need to be parsed to determine whether an alarm has been triggered. Given the following code function:
Which of the following is most likely the log input that the code will parse? A.
Exhibits
Options
- B<"error_log"><"system_1"></"InAlarmstate"="True"></"system_1"></"error_l
- D<"error_log": {"system_1": {"InAlarmState": True }}}
How the community answered
(27 responses)- B11% (3)
- D89% (24)
Explanation
Based on the provided Python code snippet, the answer <"error_log": {"system_1": {"InAlarmState": True }} is a minimal example of the JSON data structure that would cause the code's if condition to evaluate as True. The code checks for the presence and value of a nested key: if parsed_log["error_log"]["system_1"]["InAlarmState"]: print("System 1 is in an alarm state!")
Community Discussion
No community discussion yet for this question.

