MongoDB 输出插件
此插件将指标写入MongoDB,如果集合不存在,则会自动创建为时间序列集合。
此插件需要 MongoDB v5 或更高版本才能使用时间序列集合。
引入于: Telegraf v1.21.0 标签: datastore 操作系统支持: all
全局配置选项
插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md。
Secret-store 支持
此插件支持从 secret-stores 获取 username 和 password 选项的密钥。有关如何使用它们的更多详细信息,请参阅 secret-store 文档。
配置
# A plugin that can transmit logs to mongodb
[[outputs.mongodb]]
# connection string examples for mongodb
dsn = "mongodb://:27017"
# dsn = "mongodb://mongod1:27017,mongod2:27017,mongod3:27017/admin&replicaSet=myReplSet&w=1"
# overrides serverSelectionTimeoutMS in dsn if set
# timeout = "30s"
# default authentication, optional
# authentication = "NONE"
# for SCRAM-SHA-256 authentication
# authentication = "SCRAM"
# username = "root"
# password = "***"
## for PLAIN authentication (e.g., LDAP)
## IMPORTANT: PLAIN authentication sends credentials in plaintext during the
## authentication handshake. Always use TLS to encrypt credentials in transit.
# authentication = "PLAIN"
# username = "myuser"
# password = "***"
# for x509 certificate authentication
# authentication = "X509"
# tls_ca = "ca.pem"
# tls_key = "client.pem"
# # tls_key_pwd = "changeme" # required for encrypted tls_key
# insecure_skip_verify = false
# database to store measurements and time series collections
# database = "telegraf"
# granularity can be seconds, minutes, or hours.
# configuring this value will be based on your input collection frequency.
# see https://docs.mongodb.com/manual/core/timeseries-collections/#create-a-time-series-collection
# granularity = "seconds"
# optionally set a TTL to automatically expire documents from the measurement collections.
# ttl = "360h"此页面是否有帮助?
感谢您的反馈!
支持和反馈
感谢您成为我们社区的一员!我们欢迎并鼓励您对 Telegraf 和本文档提出反馈和 bug 报告。要获取支持,请使用以下资源
具有年度合同或支持合同的客户可以 联系 InfluxData 支持。