0

I am trying to make destination for my user activity log but every time I type --auditDestination I get errormessage "unrecognized option --auditDestination", can anyone tell me what should I do?

I really need a help with this, if anyone can help with some solution I will be grateful :/

4
  • 3
    What version of Mongo, what OS, and what are you trying to use as the destination? Commented Dec 1, 2017 at 15:20
  • I'm using Mongo Enterprise on Win 10 and I'm trying to put JSON audit file in folder on my C disc
    – JoDi
    Commented Dec 2, 2017 at 19:25
  • @JoDi, Could you elaborate bit more , what you are writing syntax for '--auditDestination' in MongoDB Enterprise 'mongod' server or 'configuration file' . Commented Dec 5, 2017 at 11:30
  • Specifically, I want to put user activity log in one json file on my computer (c disc) and I'm trying to run command from Windows PowerShell, like this: "mongod --dbpath data/db --auditDestination file --auditFormat JSON --auditPath data/db/auditLog.json"
    – JoDi
    Commented Dec 5, 2017 at 12:07

2 Answers 2

0

--auditDestination is parameter of mongoD and mongoS, if you try to use it with mongo command, you get error message.

2
  • I know that and I tried with both mongoD and mongoS but nothing :(
    – JoDi
    Commented Dec 2, 2017 at 19:26
  • It must be that windows.. I have linux enterprise 3.4 and it's working fine.
    – JJussi
    Commented Dec 3, 2017 at 8:59
0

@JoDi, as you said your environment is windows and you want to --auditDestination in 'c:\' .

As per MongoDB BOL Configure Auditing To enable auditing and print audit events to a file in JSON format, specify file for the --auditDestination setting, JSON for the --auditFormat setting, and the output filename for the --auditPath. The --auditPath option accepts either full path name or relative path name. For example, the following enables auditing and records audit events to a file with the relative path name of data/db/auditLog.json:

mongod --dbpath data/db --auditDestination file --auditFormat JSON --auditPath data/db/auditLog.json

As here dbpath is C:\data\db , file is the destination file location & AuditPath is C:\data\db\auditLog.json

You may also specify these options in the configuration file:

storage:
   dbPath: data/db
auditLog:
   destination: file
   format: JSON
   path: data/db/auditLog.json

NOTE Printing audit events to a file in JSON format degrades server performance more than printing to a file in BSON format.

1
  • Thank you for replaying, I did everything what did you say but the problem is that when I type any of this (--auditDestination, --auditFormat...) I'm getting error message that this options didn't recognised
    – JoDi
    Commented Dec 5, 2017 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.