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


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
Take the 2021 Splunk Career Survey

Help us learn about how Splunk has
impacted your career by taking the 2021 Splunk Career Survey.

Earn $50 in Amazon cash!