Skip to content

Commit

Permalink
Use the generic helper for opening file to read
Browse files Browse the repository at this point in the history
Closes #29113
  • Loading branch information
kvch committed Nov 29, 2021
1 parent 7ad6800 commit 60cfe1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion filebeat/input/filestream/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
input "github.com/elastic/beats/v7/filebeat/input/v2"
"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/common/cleanup"
"github.com/elastic/beats/v7/libbeat/common/file"
"github.com/elastic/beats/v7/libbeat/common/match"
"github.com/elastic/beats/v7/libbeat/feature"
"github.com/elastic/beats/v7/libbeat/logp"
Expand Down Expand Up @@ -244,7 +245,7 @@ func (inp *filestream) openFile(log *logp.Logger, path string, offset int64) (*o
}

ok := false
f, err := os.OpenFile(path, os.O_RDONLY, os.FileMode(0))
f, err := file.ReadOpen(path)
if err != nil {
return nil, fmt.Errorf("failed opening %s: %s", path, err)
}
Expand Down

0 comments on commit 60cfe1f

Please sign in to comment.