# Need to send mongoDb logs to some port then that can be used in logstash

**URL:** <https://discuss.elastic.co/t/need-to-send-mongodb-logs-to-some-port-then-that-can-be-used-in-logstash/92463>\
**Category:** Logstash\
**Created:** [July 10, 2017, 12:12pm UTC](https://discuss.elastic.co/t/need-to-send-mongodb-logs-to-some-port-then-that-can-be-used-in-logstash/92463 "2017-07-10T12:12:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeygidwani](https://avatars.discourse-cdn.com/v4/letter/h/e9a140/32.png) [@honeygidwani](https://discuss.elastic.co/u/honeygidwani)\
**Post date:** [July 10, 2017, 12:12pm UTC](https://discuss.elastic.co/t/need-to-send-mongodb-logs-to-some-port-then-that-can-be-used-in-logstash/92463/1 "2017-07-10T12:12:44Z")

</div>

I am trying to send all mongoDb logs to some defined port  
This is because I am using replication and sharding in this. So i want to collect all the logs at some port . I am right now using file input for logstash to read mongologs. But this is not the properway . Because everytime when I will add new replica set. I need to change the config file of logstash. So please guide me the way to achieve it and it there is some better way than this please tell me that too.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 12, 2017, 12:28pm UTC](https://discuss.elastic.co/t/need-to-send-mongodb-logs-to-some-port-then-that-can-be-used-in-logstash/92463/2 "2017-07-12T12:28:05Z")

</div>

Can't you use wildcards in the file input's `path` option to match all possible log files? Then Logstash will periodically scan the disk and pick up new files.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 9, 2017, 12:28pm UTC](https://discuss.elastic.co/t/need-to-send-mongodb-logs-to-some-port-then-that-can-be-used-in-logstash/92463/3 "2017-08-09T12:28:05Z")

</div>

Closed on August 9, 2017, 12:28pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
