【发布时间】:2023-04-01 13:12:01
【问题描述】:
我们需要将我们的 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>
【问题讨论】:
-
你能分享你的 fluent.conf 看看你在做什么以及可以做什么?
-
我正在添加。请注意,它仍在开发中。
标签: node.js mongodb fluentd td-agent