What privileges mongodb user should have for fetching the mongodb status through metricbeat mongodb module

In mongodb.yml file inside metricbeat modules, i am using user which is assign readWrite permission for admin db.

I am getting these errors

Error 1 : Error fetching data for metricset mongodb.dbstats: Error retrieving database names from Mongo instance: not authorized on admin to execute command { listDatabases: 1, $readPreference: { mode: "secondaryPreferred" }, $db: "admin" }

What role need to be use for fetching the mongodb status.
In production environment i can not use "root" role for security reason.

Sorry right now we don't have the privileges documented, a github issue is created to track this work: https://github.com/elastic/beats/issues/13820

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.