This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Auditing”.
1. The auditing facility can write audit events to the console, the _________ a JSON file, or a BSON file.
a) oplog
b) syslog
c) evallog
d) none of the mentioned
View Answer
Explanation: MongoDB provides an option to send output to the host’s syslog system.
2. Point out the correct statement.
a) When a process writes to a resource, it takes an exclusive write lock to prevent other processes from writing to or reading from that resource
b) As clients insert new documents into the capped collection, the tailable cursor continues to retrieve documents
c) Write concern allows your application to detect insertion errors or unavailable mongod instances
d) All of the mentioned
View Answer
Explanation: MongoDB Enterprise includes an auditing capability for mongod and mongos instances.
3. _________ contains the local ip address and the port number of the running instance.
a) ts
b) local
c) remote
d) users
View Answer
Explanation: Remote document contains the remote ip address and the port number of the incoming connection associated with the event.
4. Enabling _____________ degrades performance more than logging only the authorization failures.
a) auditAuthorizationFailure
b) auditAuthorizationSuccess
c) auditAuthorizationlog
d) none of the mentioned
View Answer
Explanation: System Event Audit Message is available only in MongoDB Enterprise.
5. Use the ____________ option to enable auditing and specify where to output the audit events.
a) –auditLocation
b) –auditOutput
c) –auditDestination
d) None of the mentioned
View Answer
Explanation: For sharded clusters, if you enable auditing on mongos instances, you must enable auditing on all mongod instances in the cluster, i.e. shards and config servers.
6. The audit file rotates at the same time as the ________ log file.
a) Client
b) Server
c) Application
d) All of the mentioned
View Answer
Explanation: Printing audit events to a file in JSON format degrades server performance more than printing to a file in BSON format.
7. To view the contents of the file, pass the file to the MongoDB utility ___________
a) bsonlog
b) bsonout
c) bsondump
d) SelectIndexes
View Answer
Explanation: The following converts the audit log into a human-readable form and output to the terminal: bsondump data/db/auditLog.bson .
8. The _____________ option accepts either full path name or relative path name.
a) –auditPathLog
b) –logPath
c) –auditPath
d) None of the mentioned
View Answer
Explanation: To enable auditing and print audit events to a file in BSON binary format, specify file for the –auditDestination setting, BSON for the –auditFormat setting, and the output filename for the –auditPath.
9. The _________ message limit can result in the truncation of the audit messages.
a) oplog
b) syslog
c) evallog
d) none of the mentioned
View Answer
Explanation: The auditing system will neither detect the truncation nor error upon its occurrence.
Sanfoundry Global Education & Learning Series – MongoDB.
Here’s the list of Best Books in MongoDB.
- Check MongoDB Books
- Practice Programming MCQs
- Check Information Technology Books
- Apply for Programming Internship