Delete seek_offset, seek_whence and follow configs for tail input plugin
This commit is contained in:
parent
b99298f851
commit
6546f557bf
|
@ -330,12 +330,6 @@ For details, please see the comments in the following configuration example.
|
||||||
##
|
##
|
||||||
filename = "/var/log/nginx/access.ltsv.log"
|
filename = "/var/log/nginx/access.ltsv.log"
|
||||||
|
|
||||||
## Seek to this location before tailing
|
|
||||||
seek_offset = 0
|
|
||||||
|
|
||||||
## Seek from whence. See https://golang.org/pkg/os/#File.Seek
|
|
||||||
seek_whence = 0
|
|
||||||
|
|
||||||
## Reopen recreated files (tail -F)
|
## Reopen recreated files (tail -F)
|
||||||
re_open = true
|
re_open = true
|
||||||
|
|
||||||
|
@ -348,9 +342,6 @@ For details, please see the comments in the following configuration example.
|
||||||
## Set this to true if the file is a named pipe (mkfifo)
|
## Set this to true if the file is a named pipe (mkfifo)
|
||||||
pipe = false
|
pipe = false
|
||||||
|
|
||||||
## Continue looking for new lines (tail -f)
|
|
||||||
follow = true
|
|
||||||
|
|
||||||
## If non-zero, split longer lines into multiple lines
|
## If non-zero, split longer lines into multiple lines
|
||||||
max_line_size = 0
|
max_line_size = 0
|
||||||
|
|
||||||
|
|
|
@ -32,12 +32,6 @@ It works like the BSD `tail` command and can keep reading when more logs are add
|
||||||
##
|
##
|
||||||
filename = "/var/log/nginx/access.ltsv.log"
|
filename = "/var/log/nginx/access.ltsv.log"
|
||||||
|
|
||||||
## Seek to this location before tailing
|
|
||||||
seek_offset = 0
|
|
||||||
|
|
||||||
## Seek from whence. See https://golang.org/pkg/os/#File.Seek
|
|
||||||
seek_whence = 0
|
|
||||||
|
|
||||||
## Reopen recreated files (tail -F)
|
## Reopen recreated files (tail -F)
|
||||||
re_open = true
|
re_open = true
|
||||||
|
|
||||||
|
@ -50,9 +44,6 @@ It works like the BSD `tail` command and can keep reading when more logs are add
|
||||||
## Set this to true if the file is a named pipe (mkfifo)
|
## Set this to true if the file is a named pipe (mkfifo)
|
||||||
pipe = false
|
pipe = false
|
||||||
|
|
||||||
## Continue looking for new lines (tail -f)
|
|
||||||
follow = true
|
|
||||||
|
|
||||||
## If non-zero, split longer lines into multiple lines
|
## If non-zero, split longer lines into multiple lines
|
||||||
max_line_size = 0
|
max_line_size = 0
|
||||||
|
|
||||||
|
|
|
@ -34,12 +34,6 @@ const sampleConfig = `
|
||||||
##
|
##
|
||||||
filename = "/var/log/nginx/access.ltsv.log"
|
filename = "/var/log/nginx/access.ltsv.log"
|
||||||
|
|
||||||
## Seek to this location before tailing
|
|
||||||
seek_offset = 0
|
|
||||||
|
|
||||||
## Seek from whence. See https://golang.org/pkg/os/#File.Seek
|
|
||||||
seek_whence = 0
|
|
||||||
|
|
||||||
## Reopen recreated files (tail -F)
|
## Reopen recreated files (tail -F)
|
||||||
re_open = true
|
re_open = true
|
||||||
|
|
||||||
|
@ -52,9 +46,6 @@ const sampleConfig = `
|
||||||
## Set this to true if the file is a named pipe (mkfifo)
|
## Set this to true if the file is a named pipe (mkfifo)
|
||||||
pipe = false
|
pipe = false
|
||||||
|
|
||||||
## Continue looking for new lines (tail -f)
|
|
||||||
follow = true
|
|
||||||
|
|
||||||
## If non-zero, split longer lines into multiple lines
|
## If non-zero, split longer lines into multiple lines
|
||||||
max_line_size = 0
|
max_line_size = 0
|
||||||
|
|
||||||
|
@ -134,16 +125,12 @@ type Tail struct {
|
||||||
Filename string
|
Filename string
|
||||||
|
|
||||||
// File-specfic
|
// File-specfic
|
||||||
SeekOffset int64 // Seek to this location before tailing
|
|
||||||
SeekWhence int // Seek from whence. See https://golang.org/pkg/os/#File.Seek
|
|
||||||
ReOpen bool // Reopen recreated files (tail -F)
|
ReOpen bool // Reopen recreated files (tail -F)
|
||||||
MustExist bool // Fail early if the file does not exist
|
MustExist bool // Fail early if the file does not exist
|
||||||
Poll bool // Poll for file changes instead of using inotify
|
Poll bool // Poll for file changes instead of using inotify
|
||||||
Pipe bool // Is a named pipe (mkfifo)
|
Pipe bool // Is a named pipe (mkfifo)
|
||||||
// TODO: Add configs for RateLimiter
|
|
||||||
|
|
||||||
// Generic IO
|
// Generic IO
|
||||||
Follow bool // Continue looking for new lines (tail -f)
|
|
||||||
MaxLineSize int // If non-zero, split longer lines into multiple lines
|
MaxLineSize int // If non-zero, split longer lines into multiple lines
|
||||||
|
|
||||||
DisableLogging bool // If false, logs are printed to stderr
|
DisableLogging bool // If false, logs are printed to stderr
|
||||||
|
@ -177,15 +164,11 @@ func (t *Tail) Start(acc telegraf.Accumulator) error {
|
||||||
t.done = make(chan struct{})
|
t.done = make(chan struct{})
|
||||||
|
|
||||||
config := tailfile.Config{
|
config := tailfile.Config{
|
||||||
Location: &tailfile.SeekInfo{
|
|
||||||
Offset: t.SeekOffset,
|
|
||||||
Whence: t.SeekWhence,
|
|
||||||
},
|
|
||||||
ReOpen: t.ReOpen,
|
ReOpen: t.ReOpen,
|
||||||
MustExist: t.MustExist,
|
MustExist: t.MustExist,
|
||||||
Poll: t.Poll,
|
Poll: t.Poll,
|
||||||
Pipe: t.Pipe,
|
Pipe: t.Pipe,
|
||||||
Follow: t.Follow,
|
Follow: true,
|
||||||
MaxLineSize: t.MaxLineSize,
|
MaxLineSize: t.MaxLineSize,
|
||||||
}
|
}
|
||||||
if t.DisableLogging {
|
if t.DisableLogging {
|
||||||
|
|
Loading…
Reference in New Issue