A. Audit logging requires restart of mongod service
B. The path is invalid and MongoDB cannot write logs
C. Filter syntax is incorrect; it should use $in operator
D. Format JSON is not supported for audit logs
Solution
Step 1: Check configuration correctness
The filter syntax is valid for a single event type; JSON format and path are correct.
Step 2: Consider service restart requirement
Changes in mongod.conf require restarting the mongod service to apply new audit logging settings.
Final Answer:
Audit logging requires restart of mongod service -> Option A
Quick Check:
Config changes need restart [OK]
Hint: Restart mongod after config changes to enable audit logging [OK]
Common Mistakes:
Assuming filter syntax error without checking
Ignoring need to restart mongod
Thinking JSON format is unsupported
5. You want to log all user management events except dropUser. Which filter correctly achieves this in mongod.conf?
hard
A. filter: '{ atype: { $in: ["createUser", "updateUser"] } }'
B. filter: '{ atype: { $eq: "dropUser" } }'
C. filter: '{ atype: { $nin: ["dropUser"] } }'
D. filter: '{ atype: "dropUser" }'
Solution
Step 1: Understand $nin operator
The $nin operator excludes specified values, so { $nin: ["dropUser"] } excludes dropUser events.
Step 2: Check other options
filter: '{ atype: { $in: ["createUser", "updateUser"] } }' logs only createUser and updateUser, missing other user events. Options B and C log only dropUser events, opposite of requirement.