# Logstash takes all the collections from mongodb that has the collection string

**URL:** <https://discuss.elastic.co/t/logstash-takes-all-the-collections-from-mongodb-that-has-the-collection-string/259564>\
**Category:** Logstash\
**Created:** [December 24, 2020, 8:25am UTC](https://discuss.elastic.co/t/logstash-takes-all-the-collections-from-mongodb-that-has-the-collection-string/259564 "2020-12-24T08:25:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Siddhanta\_Das](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/siddhanta_das/32/81358_2.png) [@Siddhanta\_Das](https://discuss.elastic.co/u/Siddhanta_Das)\
**Post date:** [December 24, 2020, 8:25am UTC](https://discuss.elastic.co/t/logstash-takes-all-the-collections-from-mongodb-that-has-the-collection-string/259564/1 "2020-12-24T08:25:20Z")

</div>

I have a issue with the collection string in config file input. I have two collection with "properties" and "favourite\_properties". When I run the mongo conf file it retrive both the collection but I wan only one

```auto
input{
mongodb{
	uri=>"mongodb://localhost:27017/ebyat"
	placeholder_db_dir => "/opt/logstash-mongodb/"
	placeholder_db_name => "logstash_sqlite.db"
	collection => "properties"
	batch_size => 5000	
}
}
filter{
	mutate{
		remove_field=>["_id"]
	}
}
output{
	stdout{
		codec => rubydebug{
				metadata => true
			}
	}
	elasticsearch{
		action => "index"		
		index => "ebyat_properties"
		hosts => ["localhost:9200"]
	}
}

```

Can any one have a solution please help..  
Thankls In Advance

---

<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:** [January 21, 2021, 8:25am UTC](https://discuss.elastic.co/t/logstash-takes-all-the-collections-from-mongodb-that-has-the-collection-string/259564/2 "2021-01-21T08:25:32Z")

</div>

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