filestat

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MIT Imports: 8 Imported by: 0

README

filestat Input Plugin

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

Configuration
# Read stats about given file(s)
[[inputs.filestat]]
  instance_id = "" # unique instance identifier (REQUIRED)

  ## 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/circonus-unified-agent/circonus-unified-agent.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)
    • modification_time (int, unix time nanoseconds)
    • md5 (optional, string)
Tags
  • All measurements have the following tags:
    • file (the path the to file, as specified in the config)
Example Output
$ circonus-unified-agent --config /etc/circonus-unified-agent/circonus-unified-agent.conf --input-filter filestat --test
* Plugin: filestat, Collection 1
> filestat,file=/tmp/foo/bar,host=tyrion exists=0i 1507218518192154351
> filestat,file=/Users/sparrc/ws/circonus-unified-agent.conf,host=tyrion exists=1i,size=47894i,modification_time=1507152973123456789i  1507218518192154351

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStat

type FileStat struct {
	Log cua.Logger

	Files  []string
	SHA256 bool
	// contains filtered or unexported fields
}

func NewFileStat

func NewFileStat() *FileStat

func (*FileStat) Description

func (*FileStat) Description() string

func (*FileStat) Gather

func (f *FileStat) Gather(ctx context.Context, acc cua.Accumulator) error

func (*FileStat) SampleConfig

func (*FileStat) SampleConfig() string

Jump to

Keyboard shortcuts

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