README.rdoc in fluent-plugin-mongo-0.6.2 vs README.rdoc in fluent-plugin-mongo-0.6.3

- old
+ new

@@ -1,36 +1,29 @@ -= MongoDB plugin for Fluent += MongoDB plugin for Fluentd -== Component +fluent-plugin-mongo provides input and output plugins for {Fluentd}[http://fluentd.org/]. -=== MongoOutput += Installation -Store Fluentd event as a MongoDB Document to MongoDB database. +== Gems -MongoOutput set "time" field to a document by default. -You set _false_ to _include_time_key_ parameter if you disable this behaivor. +The gem is hosted at {Rubygems.org}[http://rubygems.org]. You can install the gem as follows: -==== tag mapped mode + $ fluent-gem install fluent-plugin-mongo -Tag mapped to MongoDB collection automatically. += Plugins -=== MongoReplSetOutput +== Output plugin -Replica Set version of MongoOutput +=== mongo -=== MongoBackupOutput +Store Fluentd event to MongoDB database. -Store fluent-event to local capped collection for backup. +==== Configuration -=== MongoTailInput +Use _mongo_ type in match. -Tail capped collection to input data. - -== Configuration - -=== MongoOutput - <match mongo.**> type mongo database fluent collection test @@ -40,17 +33,25 @@ # Set 'capped' if you want to use capped collection capped capped_size 100m + # Set 'user' and 'password' for authentication + user handa + password shinobu + # Other buffer configurations here </match> -==== Tag mapped mode +=== mongo(tag mapped mode) -Use _tag_mapped_ parameter. +Tag mapped to MongoDB collection automatically. +==== Configuration + +Use _tag_mapped_ parameter in match of _mongo_ type. + If tag name is "foo.bar", auto create collection "foo.bar" and insert data. <match forward.*> type mongo database fluent @@ -66,53 +67,16 @@ collection misc # Other configurations here </match> -==== NOTE +=== mongo_replset -===== Broken data as a BSON +Replica Set version of mongo. -Fluentd event sometimes has an invalid record as a BSON. -In such case, Mongo plugin marshals an invalid record using Marshal.dump -and re-inserts its to same collection. +==== Configuration -If passed following invalid record: - - {"key1": "invalid value", "key2": "valid value", "time": ISODate("2012-01-15T21:09:53Z") } - -then Mongo plugin converts this record to following format: - - {"__broken_data": Marshal.dump result of {"key1": "invalid value", "key2": "valid value"}, "time": ISODate("2012-01-15T21:09:53Z") } - -Mongo-Ruby-Driver cannot detect an invalid attribute, -so Mongo plugin marshals all attributes excluding Fluentd keys("tag_key" and "time_key"). - -If you want to ignore an invalid record, set _true_ to _ignore_invalid_record_ parameter in match. - - <match forward.*> - ... - - # ignore invalid documents at write operation - ignore_invalid_document true - - ... - </match> - -===== Buffer size limitation - -Mongo plugin has the limitation of buffer size. -Because MongoDB and mongo-ruby-driver checks the total object size at each insertion. -If total object size gets over the size limitation, then -MongoDB returns error or mongo-ruby-driver raises an exception. - -So, Mongo plugin resets _buffer_chunk_limit_ if configurated value is larger than above limitation: -- Before v1.8, max of _buffer_chunk_limit_ is 2MB -- After v1.8, max of _buffer_chunk_limit_ is 10MB - -=== MongoReplSetOutput - Use _mongo_replset_ type in match. <match mongo.**> type mongo_replset database fluent @@ -131,12 +95,16 @@ #read secondary #refresh_mode sync #refresh_interval 60 </match> -=== MongoBackupOutput +=== mongo_backup +Store Fluentd event to local capped collection for backup. + +==== Configuration + Use _mongo_backup_ type in match. _mongo_backup_ alwalys use capped collection. <match ...> type mongo_backup capped_size 100m @@ -146,12 +114,18 @@ host 192.168.0.13 ... </store> </match> -=== Tail capped collection +== Input plugin +=== mongo_tail + +Tail capped collection to input data. + +==== Configuration + Use _mongo_tail_ type in source. <source> type mongo_tail database fluent @@ -164,23 +138,63 @@ # You can store last ObjectId to tail over server's shutdown id_store_file /Users/repeatedly/devel/fluent-plugin-mongo/last_id </source> -== TODO += NOTE -=== More configuration +== Broken data as a BSON -- Authentication -- Select insert or update -- etc +Fluentd event sometimes has an invalid record as a BSON. +In such case, Mongo plugin marshals an invalid record using Marshal.dump +and re-inserts its to same collection. -== Tool +If passed following invalid record: + {"key1": "invalid value", "key2": "valid value", "time": ISODate("2012-01-15T21:09:53Z") } + +then Mongo plugin converts this record to following format: + + {"__broken_data": Marshal.dump result of {"key1": "invalid value", "key2": "valid value"}, "time": ISODate("2012-01-15T21:09:53Z") } + +Mongo-Ruby-Driver cannot detect an invalid attribute, +so Mongo plugin marshals all attributes excluding Fluentd keys("tag_key" and "time_key"). + +If you want to ignore an invalid record, set _true_ to _ignore_invalid_record_ parameter in match. + + <match forward.*> + ... + + # ignore invalid documents at write operation + ignore_invalid_record true + + ... + </match> + +== Buffer size limitation + +Mongo plugin has the limitation of buffer size. +Because MongoDB and mongo-ruby-driver checks the total object size at each insertion. +If total object size gets over the size limitation, then +MongoDB returns error or mongo-ruby-driver raises an exception. + +So, Mongo plugin resets _buffer_chunk_limit_ if configurated value is larger than above limitation: +- Before v1.8, max of _buffer_chunk_limit_ is 2MB +- After v1.8, max of _buffer_chunk_limit_ is 10MB + += Tool + You can tail mongo capped collection. - mongo-tail -f + $ mongo-tail -f -== Copyright += TODO + +== More configuration + +- Multi process +- etc + += Copyright Copyright:: Copyright (c) 2011- Masahiro Nakagawa License:: Apache License, Version 2.0