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
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...