telegraf/plugins/inputs/filestat
Cameron Sparr 07728d7425 Refactor globpath pkg to return a map
this is so that we don't call os.Stat twice for every file matched
by Match(). Also changing the behavior to _not_ return the name of a
file that doesn't exist if it's not a glob.
2016-04-24 14:37:44 -06:00
..
testdata filestat input plugin 2016-04-21 16:53:02 -06:00
README.md filestat input plugin 2016-04-21 16:53:02 -06:00
filestat.go Refactor globpath pkg to return a map 2016-04-24 14:37:44 -06:00
filestat_test.go globpath refactor into pkg separate from filestat 2016-04-23 11:56:33 -06:00

README.md

filestat Input Plugin

The filestat plugin gathers metrics about file existence, size, and other stats.

Configuration:

# Read stats about given file(s)
[[inputs.filestat]]
  ## Files to gather stats about.
  ## These accept standard unix glob matching rules, but with the addition of
  ## ** as a "super asterisk". See https://github.com/gobwas/glob.
  files = ["/etc/telegraf/telegraf.conf", "/var/log/**.log"]
  ## If true, read the entire file and calculate an md5 checksum.
  md5 = false

Measurements & Fields:

  • filestat
    • exists (int, 0 | 1)
    • size_bytes (int, bytes)
    • md5 (optional, string)

Tags:

  • All measurements have the following tags:
    • file (the path the to file, as specified in the config)

Example Output:

$ telegraf -config /etc/telegraf/telegraf.conf -input-filter filestat -test
* Plugin: filestat, Collection 1
> filestat,file=/tmp/foo/bar,host=tyrion exists=0i 1461203374493128216
> filestat,file=/Users/sparrc/ws/telegraf.conf,host=tyrion exists=1i,size=47894i 1461203374493199335