fluent / fluent-plugin-mongo

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

Capped collection not created #90

Closed ceecko closed 6 years ago

ceecko commented 7 years ago

When using v0.8.0 the capped collection config is not applied. Here's the config we use:

  <match docker.*>
    type mongo_replset
    tag_mapped
    remove_tag_prefix docker.
    flush_interval 10s
    max_retry_wait 60s
    host myhost.example.com
    replica_set rs0
    user logs
    password xxx
    database logs
    capped
    capped_size 2097152
  </match>

The resulting collection is not capped.

aferreira commented 7 years ago

I think that broke with the commit https://github.com/fluent/fluent-plugin-mongo/commit/d89267652f6d417e906e818ee7139f3ebba3d3f9 – for the transition to the new MongoDB driver, it was assumed that

@client[collection, @collection_options].insert_many(records)

would create the collection implicitly by applying @collection_options but that is not what happens.

cosmo0920 commented 6 years ago

Could you send your patch into this repository, @aferreira ?

cosmo0920 commented 6 years ago

Ah, it is already sent here. I'll check it.

repeatedly commented 6 years ago

Merged patch.