Skip to content

Commit

Permalink
If permission denied delete old tailer
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmiller-wpengine committed Nov 27, 2023
1 parent 1c2c03d commit ed70d7e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/inputs/tail/tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ func (t *Tail) tailNewFiles(fromBeginning bool) error {

if err := tailer.Err(); err != nil {
t.Log.Errorf("Tailing %q: %s", tailer.Filename, err.Error())
if strings.HasSuffix(err.Error(), "permission denied") {
t.Log.Errorf("Deleting tailer for %q", tailer.Filename)
delete(t.tailers, tailer.Filename)
}
}
}()

Expand Down

0 comments on commit ed70d7e

Please sign in to comment.