|
@@ -39,6 +39,7 @@ type FileConfiguration struct {
|
|
|
Filename string
|
|
|
ForceInotify bool `yaml:"force_inotify"`
|
|
|
MaxBufferSize int `yaml:"max_buffer_size"`
|
|
|
+ PollWithoutInotify bool `yaml:"poll_without_inotify"`
|
|
|
configuration.DataSourceCommonCfg `yaml:",inline"`
|
|
|
}
|
|
|
|
|
@@ -328,7 +329,7 @@ func (f *FileSource) StreamingAcquisition(out chan types.Event, t *tomb.Tomb) er
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
- tail, err := tail.TailFile(file, tail.Config{ReOpen: true, Follow: true, Poll: true, Location: &tail.SeekInfo{Offset: 0, Whence: io.SeekEnd}, Logger: log.NewEntry(log.StandardLogger())})
|
|
|
+ tail, err := tail.TailFile(file, tail.Config{ReOpen: true, Follow: true, Poll: f.config.PollWithoutInotify, Location: &tail.SeekInfo{Offset: 0, Whence: io.SeekEnd}, Logger: log.NewEntry(log.StandardLogger())})
|
|
|
if err != nil {
|
|
|
f.logger.Errorf("Could not start tailing file %s : %s", file, err)
|
|
|
continue
|
|
@@ -411,7 +412,7 @@ func (f *FileSource) monitorNewFiles(out chan types.Event, t *tomb.Tomb) error {
|
|
|
continue
|
|
|
}
|
|
|
//Slightly different parameters for Location, as we want to read the first lines of the newly created file
|
|
|
- tail, err := tail.TailFile(event.Name, tail.Config{ReOpen: true, Follow: true, Poll: true, Location: &tail.SeekInfo{Offset: 0, Whence: io.SeekStart}})
|
|
|
+ tail, err := tail.TailFile(event.Name, tail.Config{ReOpen: true, Follow: true, Poll: f.config.PollWithoutInotify, Location: &tail.SeekInfo{Offset: 0, Whence: io.SeekStart}})
|
|
|
if err != nil {
|
|
|
logger.Errorf("Could not start tailing file %s : %s", event.Name, err)
|
|
|
break
|