telegraf/plugins/outputs/file
Sven Rebhan d9a6d8b774
chore: embed sample configurations into README for outputs (#11182)
2022-05-25 08:48:59 -06:00
..
README.md chore: embed sample configurations into README for outputs (#11182) 2022-05-25 08:48:59 -06:00
file.go chore: embed sample configurations into README for outputs (#11182) 2022-05-25 08:48:59 -06:00
file_test.go test: use `T.TempDir` to create temporary test directory (#10988) 2022-04-18 13:27:59 -06:00
sample.conf chore(outputs): migrate sample configs into separate files (#11131) 2022-05-18 11:30:06 -05:00

README.md

File Output Plugin

This plugin writes telegraf metrics to files

Configuration

# Send telegraf metrics to file(s)
[[outputs.file]]
  ## Files to write to, "stdout" is a specially handled file.
  files = ["stdout", "/tmp/metrics.out"]

  ## Use batch serialization format instead of line based delimiting.  The
  ## batch format allows for the production of non line based output formats and
  ## may more efficiently encode and write metrics.
  # use_batch_format = false

  ## The file will be rotated after the time interval specified.  When set
  ## to 0 no time based rotation is performed.
  # rotation_interval = "0h"

  ## The logfile will be rotated when it becomes larger than the specified
  ## size.  When set to 0 no size based rotation is performed.
  # rotation_max_size = "0MB"

  ## Maximum number of rotated archives to keep, any older logs are deleted.
  ## If set to -1, no archives are removed.
  # rotation_max_archives = 5

  ## Data format to output.
  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
  data_format = "influx"