This commit is contained in:
Sebastien Blot 2021-04-30 12:30:18 +02:00
parent 3f3e8b4a2d
commit e175d00fed
No known key found for this signature in database
GPG key ID: DFC2902F40449F6A

View file

@ -63,6 +63,9 @@ func (f *FileSource) Configure(Config []byte, logger *log.Entry) error {
if f.config.Mode == "" {
f.config.Mode = configuration.TAIL_MODE
}
if f.config.Mode != configuration.CAT_MODE && f.config.Mode != configuration.TAIL_MODE {
return fmt.Errorf("unsupported mode %s for file source", f.config.Mode)
}
f.watcher, err = fsnotify.NewWatcher()
if err != nil {
return errors.Wrapf(err, "Could not create fsnotify watcher")