3

Is it possible to find a list of previous actions towards Mongodb?

I have a Mongodb on a linux server and some suspicious queries might've been executed, is there any way to show list of previous queries?

I called these two methods:

db.getProfilingStatus()
db.getProfilingLevel()

Output:

{ "was" : 0, "slowms" : 100 }

0

1 Answer 1

4

MongoDB does not log any database operations by default.

In order to log every operations done by the service you have to either
Set profiling level in the config file and restart service

operationProfiling:
   mode: all

or run the following command in the database instance (does not persist after service restart)

db.setProfilingLevel(2)

Note that this is for development porpuses only cuz this will slows down your database service.

Sign up to request clarification or add additional context in comments.

5 Comments

would you provide more details?
Is there alterntive? My profiling level was set to 0
I don't know any other solution. If you think your database is compromised you should manually check your database for suspicious data like new admin users added to the users collection, etc
Could you please update your answer with more info about it so I can accept it as good answer?

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.