logstash-input-mongodb
logstash-input-mongodb copied to clipboard
Input config - Mongo specific collection
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!
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.
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.
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!!