telegraf/plugins/outputs/mongodb
Joshua Powers d45c7c44c7
test: update integration test occurrences (#12085)
2022-10-21 14:18:15 -06:00
..
testdata test: update mongodb output to use test containers (#11137) 2022-05-19 14:14:02 -06:00
README.md chore: embed sample configurations into README for outputs (#11182) 2022-05-25 08:48:59 -06:00
mongodb.go docs: Remove warning not to remove go:embed (#11797) 2022-09-13 12:47:58 -05:00
mongodb_test.go test: update integration test occurrences (#12085) 2022-10-21 14:18:15 -06:00
sample.conf chore(outputs): migrate sample configs into separate files (#11131) 2022-05-18 11:30:06 -05:00

README.md

MongoDB Output Plugin

This plugin sends metrics to MongoDB and automatically creates the collections as time series collections when they don't already exist. Please note: Requires MongoDB 5.0+ for Time Series Collections

Configuration

# A plugin that can transmit logs to mongodb
[[outputs.mongodb]]
  # connection string examples for mongodb
  dsn = "mongodb://localhost: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 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"