file

package
v0.0.0-...-16a0e24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2020 License: MIT Imports: 7 Imported by: 0

README

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:
[[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"]

  ## Data format to consume.
  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  ## https://gitee.com/zhimiao/qiansi-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.
  # file_tag = ""

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Files   []string `toml:"files"`
	FileTag string   `toml:"file_tag"`
	// contains filtered or unexported fields
}

func (*File) Description

func (f *File) Description() string

func (*File) Gather

func (f *File) Gather(acc telegraf.Accumulator) error

func (*File) SampleConfig

func (f *File) SampleConfig() string

SampleConfig returns the default configuration of the Input

func (*File) SetParser

func (f *File) SetParser(p parsers.Parser)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL