我们需要将我们的 nodejs 应用程序日志保存为 MongoDB 中的记录。我们应该创建的大多数记录,但有些记录只需要更新。
我们想使用 Fluentd。我看到它可以选择将日志插入 mongo,但我找不到更新现有记录的方法。
有没有办法做到这一点?
这是我当前的 td-agent.conf(仍在开发中):
<match mongo.*>
@type mongo
host localhost
port 27017
database my-db
# Set 'tag_mapped' if you want to use tag mapped mode.
tag_mapped
# If the tag is "mongo.foo", then the prefix "mongo." is removed.
# The inserted collection name is "foo".
remove_tag_prefix mongo.
# This configuration is used if the tag is not found. The default is 'untagged'.
collection misc
</match>