fluent / fluent-plugin-mongo

MongoDB input and output plugin for Fluentd
https://docs.fluentd.org/output/mongo
173 stars 61 forks source link

Why do mongo-tail not flush stdout? #16

Closed sndyuk closed 12 years ago

sndyuk commented 12 years ago

I want to do like this:

mongo-tail -c access -d fluent -n 1 -f | grep xxx

But mongo-tail do not flush stdout. So It cloud not work.

https://github.com/fluent/fluent-plugin-mongo/blob/master/bin/mongo-tail#L68

I patched:

      puts doc.to_json
      STDOUT.flush

This code seems to work.

I don't know what is the better way. Could you fix it?

repeatedly commented 12 years ago

mongo-tail does not need the performance. So your patch is acceptable. Please wait!

repeatedly commented 12 years ago

Pushed and new version released. Thanks!