fluent / fluent-plugin-mongo

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

undefined method `to_msgpack' for 2019-12-17 23:45:44 +0530:Time - output plugin #136

Open iravishah opened 4 years ago

iravishah commented 4 years ago

Needs to store multiple Time type keys in mongodb. I am successfully able to change default time key to created_at but i want one more key with name updated_at.

@type record_transformer enable_ruby updated_at ${time}
@type copy
<store>
  @type mongo
  database test
  host localhost:27017
  user user1
  password pwd1
  collection logs
  include_time_key true
  time_key created_at
</store>

cosmo0920 commented 4 years ago

enable_msgpack_time_support in system directive may help you.

<system>
  enable_msgpack_time_support true
</system>

ref: https://docs.fluentd.org/deployment/system-config#enable_msgpack_time_support

This option makes to be able to handle Time object to encode msgpack object with Fluentd.