Add ability to set measurement from matched text in grok parser (#4433)

This commit is contained in:
maxunt
2018-08-17 13:45:22 -07:00
committed by Daniel Nelson
parent 34614582a7
commit 9e0eb0c0e0
10 changed files with 126 additions and 88 deletions

View File

@@ -11,9 +11,8 @@ import (
)
type File struct {
Files []string `toml:"files"`
FromBeginning bool
parser parsers.Parser
Files []string `toml:"files"`
parser parsers.Parser
filenames []string
}
@@ -24,7 +23,7 @@ const sampleConfig = `
## ** as a "super asterisk". ie:
## /var/log/**.log -> recursively find all .log files in /var/log
## /var/log/*/*.log -> find all .log files with a parent dir in /var/log
## /var/log/apache.log -> only tail the apache log file
## /var/log/apache.log -> only read the apache log file
files = ["/var/log/apache/access.log"]
## The dataformat to be read from files
@@ -40,7 +39,7 @@ func (f *File) SampleConfig() string {
}
func (f *File) Description() string {
return "reload and gather from file[s] on telegraf's interval"
return "Reload and gather from file[s] on telegraf's interval."
}
func (f *File) Gather(acc telegraf.Accumulator) error {