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.