telegraf/plugins/inputs/file
Sebastian Spaink 6b697db11e
chore(inputs_a-l): migrate sample configs into separate files (#11132)
2022-05-18 11:31:52 -05:00
..
dev Add ability to set measurement from matched text in grok parser (#4433) 2018-08-17 13:45:22 -07:00
testdata Support utf-16 in file and tail inputs (#7792) 2020-07-07 12:43:32 -07:00
README.md feat: migrate input plugins to new sample config format (A-L) (#10924) 2022-04-07 16:01:21 -06:00
file.go chore(inputs/file): More clear error messages (#11104) 2022-05-16 17:21:46 -05:00
file_sample_config.go feat: migrate input plugins to new sample config format (A-L) (#10924) 2022-04-07 16:01:21 -06:00
file_test.go fix: Statefull parser handling (#10575) 2022-02-03 09:15:38 -07:00
sample.conf chore(inputs_a-l): migrate sample configs into separate files (#11132) 2022-05-18 11:31:52 -05:00

README.md

File Input Plugin

The file plugin parses the complete contents of a file every interval using the selected input data format.

Note: If you wish to parse only newly appended lines use the tail input plugin instead.

Configuration

# Parse a complete file each interval
[[inputs.file]]
  ## Files to parse each interval.  Accept standard unix glob matching rules,
  ## as well as ** to match recursive files and directories.
  files = ["/tmp/metrics.out"]

  ## Character encoding to use when interpreting the file contents.  Invalid
  ## characters are replaced using the unicode replacement character.  When set
  ## to the empty string the data is not decoded to text.
  ##   ex: character_encoding = "utf-8"
  ##       character_encoding = "utf-16le"
  ##       character_encoding = "utf-16be"
  ##       character_encoding = ""
  # character_encoding = ""

  ## Data format to consume.
  ## 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_INPUT.md
  data_format = "influx"


  ## Name a tag containing the name of the file the data was parsed from.  Leave empty
  ## to disable. Cautious when file name variation is high, this can increase the cardinality
  ## significantly. Read more about cardinality here:
  ## https://docs.influxdata.com/influxdb/cloud/reference/glossary/#series-cardinality
  # file_tag = ""