Audit output format

In the lecture describing the top level fields in the audit log event, it is mentioned that users and roles are separate arrays.
I understand that we can authenticate with different users for each DB and hence an array is required. Is there a way to correlate the roles and users as they are maintained in separate arrays.

@ subrahmaniank

I’m not sure what your actual question is here. However, if you want to see all users with their roles, you can do that with the db.getUsers() command documented here.

I had a funny idea about audit format and destination.

I would like the destination to be another collection in another database possibly in another server.

This way I don’t have to scan the logs. I just go in Compass and use the power of the aggregation framework to find the information I want.

If I have time, I will try to write something in java to do it.

  1. Read lines from the audit log file continuously
  2. Parse the line and build a document from it
  3. Insert the document in audit cluster/database/document

I like it.