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!

Observability Unveiled: Navigating OpenTelemetry's Framework and Deployment Options

Observability Unveiled: Navigating OpenTelemetry's Framework and Deployment Options A recent Tech Talk, ...

Observability | How to Think About Instrumentation Overhead (White Paper)

Novice observability practitioners are often overly obsessed with performance. They might approach ...

Cloud Platform | Get Resiliency in the Cloud Event (Register Now!)

IDC Report: Enterprises Gain Higher Efficiency and Resiliency With Migration to Cloud  Today many enterprises ...