logstash-input-mongodb icon indicating copy to clipboard operation
logstash-input-mongodb copied to clipboard

Input config - Mongo specific collection

Open gairom opened this issue 10 years ago • 3 comments

Hi, Is there any way to config a specific collection instead of the regex? So if I have these collections: hits, hits-old, hits-1, I want to be able to define "hits" and get docs only from this collection without the other collections. Thanks!

gairom avatar Oct 12 '15 11:10 gairom

On the same matter, is there any way to get the doc collection? That way I'll be able to allocate different type to each collection or put them in different indexes.

gairom avatar Oct 12 '15 20:10 gairom

hey @gairom, since the collection param is just a regex, you could do "hits^" to get only the hits collection. To be even more strict you could do "$hits^".

I may in the future add a param to enable or disable regex on the collection param so this is a little less confusing...

Give it a shot and let me know if that works for you.

phutchins avatar Dec 16 '15 14:12 phutchins

Hi @phutchins , tried it, both "hits^" and "$hits^" didn't work, the listCollections return empty so I tried to change the regex and finally saw it's just a syntax problem, changed to "^hits" and "^hits$" and both worked. You can close this issue. Thanks!!

gairom avatar Dec 22 '15 21:12 gairom