Solution
Here is the updated toml file that worked for me -
mongo-url = "mongodb://mongo1:27017/?replicaSet=dbrs"
# The URL to connect to MongoDB
elasticsearch-urls = ["http://elasticsearch:9200"]
# An array of URLs to connect to the Elasticsearch REST Interface
gzip = true
# When gzip is true, monstache will compress requests to Elasticsearch.
stats = true
# When stats is true monstache will periodically print statistics accumulated by the indexer
index-stats = true
# When both stats and index-stats are true monstache will write statistics about its indexing progress in Elasticsearch instead of standard out.
elasticsearch-max-conns = 12
# The size of the Elasticsearch HTTP connection pool.
replay = true
# When replay is true, monstache replays all events from the beginning of the MongoDB oplog and syncs them to Elasticsearch.
resume = true
# When resume is true, monstache writes the timestamp of MongoDB operations it has successfully synced to Elasticsearch to the collection monstache.monstache.
#resume-name = 'default'
# monstache uses the value of resume-name as an id when storing and retrieving timestamps to and from the MongoDB collection monstache.monstache.
namespace-regex ='network.company'
# When namespace-regex is given this regex is tested against the namespace, database.collection, of any insert, update, delete in MongoDB.
direct-read-namespaces = ["network.company"]
# This option allows you to directly copy collections from MongoDB to Elasticsearch.
enable-oplog = false
# It should only be turned on when pairing monstache v5 or v6 with a MongoDB server at a server compatibility version less than 3.6.
index-as-update = true
# When index-as-update is set to true monstache will sync create and update operations in MongoDB as updates to Elasticsearch.
verbose = true
# When verbose is true monstache with enable debug logging including a trace of requests to Elasticsearch
exit-after-direct-reads = false
# direct-read-namespaces, then exit