Splunk Search

How to trigger rs.slaveOk() from Splunk MongoDB (Hunk) app to query data from secondary instance

sandeepkumar23
Explorer

We have a requirement of querying MongoDB collections from secondary instance using Splunk MongoDB app (Hunk). The virtual indexes are working perfectly fine when we configure the primary MongoDB instance in indexes.conf. However as per recommendation from DB team, we need to point our splunk to query the secondary MongoDB instance. But when we configure the secondary instance IP in indexes.conf, the virtual indexes are failing to pull data from DB. On further investigation, we found the reason is, we need to set "rs.slaveOk()" in secondary instance each time before querying the data. We don't see any option at configuration level to trigger "rs.slaveOk()" through MongoDB app.

Is there any way to achieve that? Any sort of help will be highly appreciated.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...

Index This | How many sevens are there between 1 and 100?

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