All Apps and Add-ons

MongoDB Monitoring: Is mongo authentication supported?

lraynal
Explorer

Hi,

I tried:

[mongo_admin://top]
index = mongodb
disabled = 0
interval = 30
commands = top ping
server = localhost
port = 27017
username = <user>
password = <password>
database = admin

with a valid username and password on the admin database, but it's giving me"

OperationFailure: not authorized on admin to execute command { top: 1 }

The other sourcetype="mongo:admin:ping" is working

0 Karma
1 Solution

conner_swann
Engager

In case anyone encountered this, I found the solution!

In short, YES, authentication is natively supported as this app uses pymongo. I sourced my solution from the pymongo docs here: http://api.mongodb.com/python/current/examples/authentication.html

In the host field, enter a string of this form:

mongodb://user:password@<hostname or ip>

And pymongo will handle authentication for you. If your password contains special characters, you will need to URL-Escape them. Follow the link to the pymongo docs for more details on that.

Would be nice if the app developer included this in the documentation!

View solution in original post

conner_swann
Engager

In case anyone encountered this, I found the solution!

In short, YES, authentication is natively supported as this app uses pymongo. I sourced my solution from the pymongo docs here: http://api.mongodb.com/python/current/examples/authentication.html

In the host field, enter a string of this form:

mongodb://user:password@<hostname or ip>

And pymongo will handle authentication for you. If your password contains special characters, you will need to URL-Escape them. Follow the link to the pymongo docs for more details on that.

Would be nice if the app developer included this in the documentation!

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Splunk App Dev Quarterly Roundup: AI, Agents, and Innovation!

Another quarter, another wave of innovation. From complex integrations to pushing the limits ...

Federated Search for Dynamic Data Self Storage Is Now Generally Available on Splunk ...

 Splunk is excited to announce the General Availability of Federated Search for Dynamic Data Self Storage ...

Index This | What has many keys but can’t unlock a door?

July 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...