From 6546f557bf099ceb12a9c70ab53f5a45adf7a3b9 Mon Sep 17 00:00:00 2001 From: Hiroaki Nakamura Date: Tue, 8 Mar 2016 23:28:51 +0900 Subject: [PATCH] Delete seek_offset, seek_whence and follow configs for tail input plugin --- docs/DATA_FORMATS_INPUT.md | 9 --------- plugins/inputs/tail/README.md | 9 --------- plugins/inputs/tail/tail.go | 29 ++++++----------------------- 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/docs/DATA_FORMATS_INPUT.md b/docs/DATA_FORMATS_INPUT.md index bd4ab677c..2742b864e 100644 --- a/docs/DATA_FORMATS_INPUT.md +++ b/docs/DATA_FORMATS_INPUT.md @@ -330,12 +330,6 @@ For details, please see the comments in the following configuration example. ## 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) 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) pipe = false - ## Continue looking for new lines (tail -f) - follow = true - ## If non-zero, split longer lines into multiple lines max_line_size = 0 diff --git a/plugins/inputs/tail/README.md b/plugins/inputs/tail/README.md index 4aad0bd06..04b5e87ac 100644 --- a/plugins/inputs/tail/README.md +++ b/plugins/inputs/tail/README.md @@ -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" - ## 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) 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) pipe = false - ## Continue looking for new lines (tail -f) - follow = true - ## If non-zero, split longer lines into multiple lines max_line_size = 0 diff --git a/plugins/inputs/tail/tail.go b/plugins/inputs/tail/tail.go index ec169c5a8..b1d5a4de8 100644 --- a/plugins/inputs/tail/tail.go +++ b/plugins/inputs/tail/tail.go @@ -34,12 +34,6 @@ const sampleConfig = ` ## 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) re_open = true @@ -52,9 +46,6 @@ const sampleConfig = ` ## Set this to true if the file is a named pipe (mkfifo) pipe = false - ## Continue looking for new lines (tail -f) - follow = true - ## If non-zero, split longer lines into multiple lines max_line_size = 0 @@ -134,17 +125,13 @@ type Tail struct { Filename string // 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) - MustExist bool // Fail early if the file does not exist - Poll bool // Poll for file changes instead of using inotify - Pipe bool // Is a named pipe (mkfifo) - // TODO: Add configs for RateLimiter + ReOpen bool // Reopen recreated files (tail -F) + MustExist bool // Fail early if the file does not exist + Poll bool // Poll for file changes instead of using inotify + Pipe bool // Is a named pipe (mkfifo) // 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 @@ -177,15 +164,11 @@ func (t *Tail) Start(acc telegraf.Accumulator) error { t.done = make(chan struct{}) config := tailfile.Config{ - Location: &tailfile.SeekInfo{ - Offset: t.SeekOffset, - Whence: t.SeekWhence, - }, ReOpen: t.ReOpen, MustExist: t.MustExist, Poll: t.Poll, Pipe: t.Pipe, - Follow: t.Follow, + Follow: true, MaxLineSize: t.MaxLineSize, } if t.DisableLogging {